BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d384b6a0
Commit
d384b6a0
authored
Jul 24, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rs-overcreating-users' into 'master'
Create guest users only when necessary rather than for every spec See merge request !13024
parents
883488e0
c10943d9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
new_menu_spec.rb
spec/features/explore/new_menu_spec.rb
+6
-5
issuable_slash_commands_shared_examples.rb
...pport/features/issuable_slash_commands_shared_examples.rb
+15
-4
No files found.
spec/features/explore/new_menu_spec.rb
View file @
d384b6a0
require
'spec_helper'
feature
'Top Plus Menu'
,
feature:
true
,
js:
true
do
let
(
:user
)
{
create
:user
}
let
(
:guest_user
)
{
create
:user
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
)
}
let
(
:public_project
)
{
create
(
:project
,
:public
)
}
before
do
group
.
add_owner
(
user
)
group
.
add_guest
(
guest_user
)
project
.
add_guest
(
guest_user
)
end
context
'used by full user'
do
...
...
@@ -102,7 +98,12 @@ feature 'Top Plus Menu', feature: true, js: true do
end
context
'used by guest user'
do
let
(
:guest_user
)
{
create
(
:user
)
}
before
do
group
.
add_guest
(
guest_user
)
project
.
add_guest
(
guest_user
)
sign_in
(
guest_user
)
end
...
...
spec/support/features/issuable_slash_commands_shared_examples.rb
View file @
d384b6a0
...
...
@@ -5,8 +5,6 @@ shared_examples 'issuable record that supports quick actions in its description
include
QuickActionsHelpers
let
(
:master
)
{
create
(
:user
)
}
let
(
:assignee
)
{
create
(
:user
,
username:
'bob'
)
}
let
(
:guest
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
,
title:
'ASAP'
)
}
let!
(
:label_bug
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
...
...
@@ -15,8 +13,6 @@ shared_examples 'issuable record that supports quick actions in its description
before
do
project
.
team
<<
[
master
,
:master
]
project
.
team
<<
[
assignee
,
:developer
]
project
.
team
<<
[
guest
,
:guest
]
sign_in
(
master
)
end
...
...
@@ -57,6 +53,7 @@ shared_examples 'issuable record that supports quick actions in its description
context
'with a note containing commands'
do
it
'creates a note without the commands and interpret the commands accordingly'
do
assignee
=
create
(
:user
,
username:
'bob'
)
write_note
(
"Awesome!
\n
/assign @bob
\n
/label ~bug
\n
/milestone %
\"
ASAP
\"
"
)
expect
(
page
).
to
have_content
'Awesome!'
...
...
@@ -77,6 +74,7 @@ shared_examples 'issuable record that supports quick actions in its description
context
'with a note containing only commands'
do
it
'does not create a note but interpret the commands accordingly'
do
assignee
=
create
(
:user
,
username:
'bob'
)
write_note
(
"/assign @bob
\n
/label ~bug
\n
/milestone %
\"
ASAP
\"
"
)
expect
(
page
).
not_to
have_content
'/assign @bob'
...
...
@@ -111,8 +109,12 @@ shared_examples 'issuable record that supports quick actions in its description
context
"when current user cannot close
#{
issuable_type
}
"
do
before
do
guest
=
create
(
:user
)
project
.
add_guest
(
guest
)
sign_out
(
:user
)
sign_in
(
guest
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
end
...
...
@@ -146,8 +148,12 @@ shared_examples 'issuable record that supports quick actions in its description
context
"when current user cannot reopen
#{
issuable_type
}
"
do
before
do
guest
=
create
(
:user
)
project
.
add_guest
(
guest
)
sign_out
(
:user
)
sign_in
(
guest
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
end
...
...
@@ -176,6 +182,9 @@ shared_examples 'issuable record that supports quick actions in its description
context
"when current user cannot change title of
#{
issuable_type
}
"
do
before
do
guest
=
create
(
:user
)
project
.
add_guest
(
guest
)
sign_out
(
:user
)
sign_in
(
guest
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
...
...
@@ -267,6 +276,8 @@ shared_examples 'issuable record that supports quick actions in its description
describe
"preview of note on
#{
issuable_type
}
"
do
it
'removes quick actions from note and explains them'
do
create
(
:user
,
username:
'bob'
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
page
.
within
(
'.js-main-target-form'
)
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment