Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
ea7467d2
Commit
ea7467d2
authored
Nov 24, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor group members tests a bit
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
34cc8f4a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
27 deletions
+15
-27
features/groups.feature
features/groups.feature
+0
-3
features/project/team_management.feature
features/project/team_management.feature
+2
-4
features/steps/groups.rb
features/steps/groups.rb
+13
-16
features/steps/project/team_management.rb
features/steps/project/team_management.rb
+0
-4
No files found.
features/groups.feature
View file @
ea7467d2
...
@@ -55,7 +55,6 @@ Feature: Groups
...
@@ -55,7 +55,6 @@ Feature: Groups
Scenario
:
Add user to group
Scenario
:
Add user to group
Given
gitlab user
"Mike"
Given
gitlab user
"Mike"
When
I visit group
"Owned"
members page
When
I visit group
"Owned"
members page
And
I click link
"Add members"
When
I select
"Mike"
as
"Reporter"
When
I select
"Mike"
as
"Reporter"
Then
I should see
"Mike"
in team list as
"Reporter"
Then
I should see
"Mike"
in team list as
"Reporter"
...
@@ -63,14 +62,12 @@ Feature: Groups
...
@@ -63,14 +62,12 @@ Feature: Groups
Scenario
:
Ignore add user to group when is already Owner
Scenario
:
Ignore add user to group when is already Owner
Given
gitlab user
"Mike"
Given
gitlab user
"Mike"
When
I visit group
"Owned"
members page
When
I visit group
"Owned"
members page
And
I click link
"Add members"
When
I select
"Mike"
as
"Reporter"
When
I select
"Mike"
as
"Reporter"
Then
I should see
"Mike"
in team list as
"Owner"
Then
I should see
"Mike"
in team list as
"Owner"
@javascript
@javascript
Scenario
:
Invite user to group
Scenario
:
Invite user to group
When
I visit group
"Owned"
members page
When
I visit group
"Owned"
members page
And
I click link
"Add members"
When
I select
"sjobs@apple.com"
as
"Reporter"
When
I select
"sjobs@apple.com"
as
"Reporter"
Then
I should see
"sjobs@apple.com"
in team list as invited
"Reporter"
Then
I should see
"sjobs@apple.com"
in team list as invited
"Reporter"
...
...
features/project/team_management.feature
View file @
ea7467d2
...
@@ -13,14 +13,12 @@ Feature: Project Team Management
...
@@ -13,14 +13,12 @@ Feature: Project Team Management
@javascript
@javascript
Scenario
:
Add user to project
Scenario
:
Add user to project
Given
I click link
"Add members"
When
I select
"Mike"
as
"Reporter"
And
I select
"Mike"
as
"Reporter"
Then
I should see
"Mike"
in team list as
"Reporter"
Then
I should see
"Mike"
in team list as
"Reporter"
@javascript
@javascript
Scenario
:
Invite user to project
Scenario
:
Invite user to project
Given
I click link
"Add members"
When
I select
"sjobs@apple.com"
as
"Reporter"
And
I select
"sjobs@apple.com"
as
"Reporter"
Then
I should see
"sjobs@apple.com"
in team list as invited
"Reporter"
Then
I should see
"sjobs@apple.com"
in team list as invited
"Reporter"
@javascript
@javascript
...
...
features/steps/groups.rb
View file @
ea7467d2
...
@@ -13,10 +13,6 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -13,10 +13,6 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
create
(
:user
,
name:
"Mike"
)
create
(
:user
,
name:
"Mike"
)
end
end
step
'I click link "Add members"'
do
find
(
:css
,
'button.btn-new'
).
click
end
step
'I should see group "Owned"'
do
step
'I should see group "Owned"'
do
expect
(
page
).
to
have_content
'@owned'
expect
(
page
).
to
have_content
'@owned'
end
end
...
@@ -60,14 +56,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -60,14 +56,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should see "Mike" in team list as "Reporter"'
do
step
'I should see "Mike" in team list as "Reporter"'
do
page
.
within
'.
well
-list'
do
page
.
within
'.
content
-list'
do
expect
(
page
).
to
have_content
(
'Mike'
)
expect
(
page
).
to
have_content
(
'Mike'
)
expect
(
page
).
to
have_content
(
'Reporter'
)
expect
(
page
).
to
have_content
(
'Reporter'
)
end
end
end
end
step
'I should see "Mike" in team list as "Owner"'
do
step
'I should see "Mike" in team list as "Owner"'
do
page
.
within
'.
well
-list'
do
page
.
within
'.
content
-list'
do
expect
(
page
).
to
have_content
(
'Mike'
)
expect
(
page
).
to
have_content
(
'Mike'
)
expect
(
page
).
to
have_content
(
'Owner'
)
expect
(
page
).
to
have_content
(
'Owner'
)
end
end
...
@@ -83,7 +79,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -83,7 +79,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should see "sjobs@apple.com" in team list as invited "Reporter"'
do
step
'I should see "sjobs@apple.com" in team list as invited "Reporter"'
do
page
.
within
'.
well
-list'
do
page
.
within
'.
content
-list'
do
expect
(
page
).
to
have_content
(
'sjobs@apple.com'
)
expect
(
page
).
to
have_content
(
'sjobs@apple.com'
)
expect
(
page
).
to
have_content
(
'invited'
)
expect
(
page
).
to
have_content
(
'invited'
)
expect
(
page
).
to
have_content
(
'Reporter'
)
expect
(
page
).
to
have_content
(
'Reporter'
)
...
@@ -114,32 +110,29 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -114,32 +110,29 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step
'I select user "Mary Jane" from list with role "Reporter"'
do
step
'I select user "Mary Jane" from list with role "Reporter"'
do
user
=
User
.
find_by
(
name:
"Mary Jane"
)
||
create
(
:user
,
name:
"Mary Jane"
)
user
=
User
.
find_by
(
name:
"Mary Jane"
)
||
create
(
:user
,
name:
"Mary Jane"
)
click_button
'Add members'
page
.
within
".users-group-form"
do
page
.
within
".users-group-form"
do
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
select
"Reporter"
,
from:
"access_level"
select
"Reporter"
,
from:
"access_level"
end
end
click_button
"Add users to group"
click_button
"Add users to group"
end
end
step
'I should see user "John Doe" in team list'
do
step
'I should see user "John Doe" in team list'
do
projects_with_access
=
find
(
".panel .well-list"
)
expect
(
group_members_list
).
to
have_content
(
"John Doe"
)
expect
(
projects_with_access
).
to
have_content
(
"John Doe"
)
end
end
step
'I should not see user "John Doe" in team list'
do
step
'I should not see user "John Doe" in team list'
do
projects_with_access
=
find
(
".panel .well-list"
)
expect
(
group_members_list
).
not_to
have_content
(
"John Doe"
)
expect
(
projects_with_access
).
not_to
have_content
(
"John Doe"
)
end
end
step
'I should see user "Mary Jane" in team list'
do
step
'I should see user "Mary Jane" in team list'
do
projects_with_access
=
find
(
".panel .well-list"
)
expect
(
group_members_list
).
to
have_content
(
"Mary Jane"
)
expect
(
projects_with_access
).
to
have_content
(
"Mary Jane"
)
end
end
step
'I should not see user "Mary Jane" in team list'
do
step
'I should not see user "Mary Jane" in team list'
do
projects_with_access
=
find
(
".panel .well-list"
)
expect
(
group_members_list
).
not_to
have_content
(
"Mary Jane"
)
expect
(
projects_with_access
).
not_to
have_content
(
"Mary Jane"
)
end
end
step
'project from group "Owned" has issues assigned to me'
do
step
'project from group "Owned" has issues assigned to me'
do
...
@@ -401,4 +394,8 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -401,4 +394,8 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
author:
current_user
,
author:
current_user
,
milestone:
milestone2_project3
milestone:
milestone2_project3
end
end
def
group_members_list
find
(
".panel .content-list"
)
end
end
end
features/steps/project/team_management.rb
View file @
ea7467d2
...
@@ -15,10 +15,6 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -15,10 +15,6 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
expect
(
page
).
to
have_content
(
user
.
username
)
expect
(
page
).
to
have_content
(
user
.
username
)
end
end
step
'I click link "Add members"'
do
find
(
:css
,
'button.btn-new'
).
click
end
step
'I select "Mike" as "Reporter"'
do
step
'I select "Mike" as "Reporter"'
do
user
=
User
.
find_by
(
name:
"Mike"
)
user
=
User
.
find_by
(
name:
"Mike"
)
...
...
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