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
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
member.rb
app/models/member.rb
+5
-4
groups.feature
features/groups.feature
+8
-0
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
...
@@ -81,11 +81,12 @@ 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
.
access_level
=
access_level
member
.
created_by
||=
current_user
member
.
save
member
.
access_level
=
access_level
end
member
.
save
end
end
end
end
...
...
features/groups.feature
View file @
de990aa1
...
@@ -60,6 +60,14 @@ Feature: Groups
...
@@ -60,6 +60,14 @@ Feature: Groups
Then
I should see
"Mike"
in team list as
"Reporter"
Then
I should see
"Mike"
in team list as
"Reporter"
@javascript
@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
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"
And
I click link
"Add members"
...
...
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