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
4caef63d
Unverified
Commit
4caef63d
authored
Nov 24, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 500 error when update group member permission
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
9ab2e5f5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
12 deletions
+51
-12
CHANGELOG
CHANGELOG
+1
-0
_group_member.html.haml
app/views/groups/group_members/_group_member.html.haml
+1
-1
update.js.haml
app/views/groups/group_members/update.js.haml
+1
-1
groups.feature
features/groups.feature
+7
-0
groups.rb
features/steps/groups.rb
+41
-10
No files found.
CHANGELOG
View file @
4caef63d
...
...
@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.3.0 (unreleased)
- Fix: Assignee selector is empty when 'Unassigned' is selected (Jose Corcuera)
- Fix 500 error when update group member permission
v 8.2.1
- Forcefully update builds that didn't want to update with state machine
...
...
app/views/groups/group_members/_group_member.html.haml
View file @
4caef63d
...
...
@@ -30,7 +30,7 @@
-
if
should_user_see_group_roles?
(
current_user
,
@group
)
%span
.pull-right
%strong
=
member
.
human_access
%strong
.member-access-level
=
member
.
human_access
-
if
show_controls
-
if
can?
(
current_user
,
:update_group_member
,
member
)
=
button_tag
class:
"btn-xs btn js-toggle-button"
,
...
...
app/views/groups/group_members/update.js.haml
View file @
4caef63d
:plain
$("##{dom_id(@
member)}").replaceWith('
#{
escape_javascript
(
render
(
@member
,
member:
@
member
,
show_controls:
true
))
}
');
$("##{dom_id(@
group_member)}").replaceWith('
#{
escape_javascript
(
render
(
@group_member
,
member:
@group_
member
,
show_controls:
true
))
}
');
features/groups.feature
View file @
4caef63d
...
...
@@ -74,6 +74,13 @@ Feature: Groups
When
I select
"sjobs@apple.com"
as
"Reporter"
Then
I should see
"sjobs@apple.com"
in team list as invited
"Reporter"
@javascript
Scenario
:
Edit group member permissions
Given "Mary Jane" is guest of group "Owned"
And
I visit group
"Owned"
members page
When
I change the
"Mary Jane"
role to
"Developer"
Then
I should see
"Mary Jane"
as
"Developer"
# Leave
@javascript
...
...
features/steps/groups.rb
View file @
4caef63d
...
...
@@ -26,7 +26,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step
'Group "Owned" has a public project "Public-project"'
do
group
=
Group
.
find_by
(
name:
"Owned"
)
group
=
owned_group
@project
=
create
:empty_project
,
:public
,
group:
group
,
...
...
@@ -91,7 +91,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step
'I should see group "Owned" projects list'
do
Group
.
find_by
(
name:
"Owned"
)
.
projects
.
each
do
|
project
|
owned_group
.
projects
.
each
do
|
project
|
expect
(
page
).
to
have_link
project
.
name
end
end
...
...
@@ -172,12 +172,12 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step
'I change group "Owned" avatar'
do
attach_file
(
:group_avatar
,
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
))
click_button
"Save group"
Group
.
find_by
(
name:
"Owned"
)
.
reload
owned_group
.
reload
end
step
'I should see new group "Owned" avatar'
do
expect
(
Group
.
find_by
(
name:
"Owned"
)
.
avatar
).
to
be_instance_of
AvatarUploader
expect
(
Group
.
find_by
(
name:
"Owned"
)
.
avatar
.
url
).
to
eq
"/uploads/group/avatar/
#{
Group
.
find_by
(
name
:"Owned"
).
id
}
/banana_sample.gif"
expect
(
owned_group
.
avatar
).
to
be_instance_of
AvatarUploader
expect
(
owned_group
.
avatar
.
url
).
to
eq
"/uploads/group/avatar/
#{
Group
.
find_by
(
name
:"Owned"
).
id
}
/banana_sample.gif"
end
step
'I should see the "Remove avatar" button'
do
...
...
@@ -187,16 +187,16 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step
'I have group "Owned" avatar'
do
attach_file
(
:group_avatar
,
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
))
click_button
"Save group"
Group
.
find_by
(
name:
"Owned"
)
.
reload
owned_group
.
reload
end
step
'I remove group "Owned" avatar'
do
click_link
"Remove avatar"
Group
.
find_by
(
name:
"Owned"
)
.
reload
owned_group
.
reload
end
step
'I should not see group "Owned" avatar'
do
expect
(
Group
.
find_by
(
name:
"Owned"
)
.
avatar?
).
to
eq
false
expect
(
owned_group
.
avatar?
).
to
eq
false
end
step
'I should not see the "Remove avatar" button'
do
...
...
@@ -295,18 +295,49 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I change the "Mary Jane" role to "Developer"'
do
member
=
mary_jane_member
page
.
within
"#group_member_
#{
member
.
id
}
"
do
find
(
".js-toggle-button"
).
click
page
.
within
"#edit_group_member_
#{
member
.
id
}
"
do
select
'Developer'
,
from:
'group_member_access_level'
click_on
'Save'
end
end
end
step
'I should see "Mary Jane" as "Developer"'
do
member
=
mary_jane_member
page
.
within
"#group_member_
#{
member
.
id
}
"
do
page
.
within
'.member-access-level'
do
expect
(
page
).
to
have_content
"Developer"
end
end
end
protected
def
owned_group
@owned_group
||=
Group
.
find_by
(
name:
"Owned"
)
end
def
mary_jane_member
user
=
User
.
find_by
(
name:
"Mary Jane"
)
member
=
owned_group
.
members
.
where
(
user_id:
user
.
id
).
first
end
def
assigned_to_me
(
key
)
project
.
send
(
key
).
where
(
assignee_id:
current_user
.
id
)
end
def
project
Group
.
find_by
(
name:
"Owned"
)
.
projects
.
first
owned_group
.
projects
.
first
end
def
group_milestone
group
=
Group
.
find_by
(
name:
"Owned"
)
group
=
owned_group
@project1
=
create
:project
,
group:
group
...
...
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