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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
de990aa1
Commit
de990aa1
authored
Oct 29, 2015
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed last group owner issue and added test
parent
0ea38dc5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
app/models/member.rb
app/models/member.rb
+5
-4
features/groups.feature
features/groups.feature
+8
-0
features/steps/groups.rb
features/steps/groups.rb
+18
-0
No files found.
app/models/member.rb
View file @
de990aa1
...
...
@@ -81,11 +81,12 @@ class Member < ActiveRecord::Base
member
=
members
.
build
member
.
invite_email
=
user
end
if
!
current_user
||
current_user
.
can?
(
:update_group_member
,
member
)
member
.
created_by
||=
current_user
member
.
access_level
=
access_level
member
.
created_by
||=
current_user
member
.
access_level
=
access_level
member
.
save
member
.
save
end
end
end
...
...
features/groups.feature
View file @
de990aa1
...
...
@@ -59,6 +59,14 @@ Feature: Groups
When
I select
"Mike"
as
"Reporter"
Then
I should see
"Mike"
in team list as
"Reporter"
@javascript
Scenario
:
Ignore add user to group when is already Owner
Given
gitlab user
"Mike"
When
I visit group
"Owned"
members page
And
I click link
"Add members"
When
I select
"Mike"
as
"Reporter"
Then
I should see
"Mike"
in team list as
"Owner"
@javascript
Scenario
:
Invite user to group
When
I visit group
"Owned"
members page
...
...
features/steps/groups.rb
View file @
de990aa1
...
...
@@ -48,6 +48,17 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
click_button
"Add users to group"
end
step
'I select "Mike" as "Master"'
do
user
=
User
.
find_by
(
name:
"Mike"
)
page
.
within
".users-group-form"
do
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
select
"Master"
,
from:
"access_level"
end
click_button
"Add users to group"
end
step
'I should see "Mike" in team list as "Reporter"'
do
page
.
within
'.well-list'
do
expect
(
page
).
to
have_content
(
'Mike'
)
...
...
@@ -55,6 +66,13 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should see "Mike" in team list as "Owner"'
do
page
.
within
'.well-list'
do
expect
(
page
).
to
have_content
(
'Mike'
)
expect
(
page
).
to
have_content
(
'Owner'
)
end
end
step
'I select "sjobs@apple.com" as "Reporter"'
do
page
.
within
".users-group-form"
do
select2
(
"sjobs@apple.com"
,
from:
"#user_ids"
,
multiple:
true
)
...
...
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