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
Léo-Paul Géneau
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
Show 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,13 +81,14 @@ class Member < ActiveRecord::Base
...
@@ -81,13 +81,14 @@ class Member < ActiveRecord::Base
member
=
members
.
build
member
=
members
.
build
member
.
invite_email
=
user
member
.
invite_email
=
user
end
end
if
!
current_user
||
current_user
.
can?
(
:update_group_member
,
member
)
member
.
created_by
||=
current_user
member
.
created_by
||=
current_user
member
.
access_level
=
access_level
member
.
access_level
=
access_level
member
.
save
member
.
save
end
end
end
end
end
def
invite?
def
invite?
self
.
invite_token
.
present?
self
.
invite_token
.
present?
...
...
features/groups.feature
View file @
de990aa1
...
@@ -59,6 +59,14 @@ Feature: Groups
...
@@ -59,6 +59,14 @@ Feature: Groups
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"
@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
@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
...
...
features/steps/groups.rb
View file @
de990aa1
...
@@ -48,6 +48,17 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -48,6 +48,17 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
click_button
"Add users to group"
click_button
"Add users to group"
end
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
step
'I should see "Mike" in team list as "Reporter"'
do
page
.
within
'.well-list'
do
page
.
within
'.well-list'
do
expect
(
page
).
to
have_content
(
'Mike'
)
expect
(
page
).
to
have_content
(
'Mike'
)
...
@@ -55,6 +66,13 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -55,6 +66,13 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
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
step
'I select "sjobs@apple.com" as "Reporter"'
do
page
.
within
".users-group-form"
do
page
.
within
".users-group-form"
do
select2
(
"sjobs@apple.com"
,
from:
"#user_ids"
,
multiple:
true
)
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