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
beba1a6f
Commit
beba1a6f
authored
Aug 21, 2016
by
Ruben Davila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken specs and UI for protected branches.
parent
6cbf6dd1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
app/views/projects/protected_branches/_create_protected_branch.html.haml
...cts/protected_branches/_create_protected_branch.html.haml
+4
-2
spec/features/protected_branches/access_control_ee_spec.rb
spec/features/protected_branches/access_control_ee_spec.rb
+5
-5
spec/features/protected_branches_spec.rb
spec/features/protected_branches_spec.rb
+3
-1
No files found.
app/views/projects/protected_branches/_create_protected_branch.html.haml
View file @
beba1a6f
...
...
@@ -24,7 +24,8 @@
.col-md-10
.merge_access_levels-container
=
dropdown_tag
(
'Select'
,
options:
{
toggle_class:
'js-allowed-to-merge wide'
,
options:
{
toggle_class:
'js-allowed-to-merge js-multiselect wide'
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable'
,
data:
{
field_name:
'protected_branch[merge_access_levels_attributes][0][access_level]'
,
input_id:
'merge_access_levels_attributes'
}})
.form-group
%label
.col-md-2.text-right
{
for:
'push_access_levels_attributes'
}
...
...
@@ -32,7 +33,8 @@
.col-md-10
.push_access_levels-container
=
dropdown_tag
(
'Select'
,
options:
{
toggle_class:
'js-allowed-to-push wide'
,
options:
{
toggle_class:
'js-allowed-to-push js-multiselect wide'
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable'
,
data:
{
field_name:
'protected_branch[push_access_levels_attributes][0][access_level]'
,
input_id:
'push_access_levels_attributes'
}})
.panel-footer
...
...
spec/features/protected_branches/access_control_ee_spec.rb
View file @
beba1a6f
...
...
@@ -9,10 +9,10 @@ RSpec.shared_examples "protected branches > access control > EE" do
roles
=
access_level_class
.
human_access_levels
visit
namespace_project_protected_branches_path
(
project
.
namespace
,
project
)
set_protected_branch_name
(
'master'
)
users
.
each
{
|
user
|
set_allowed_to
(
git_operation
,
user
.
name
)
}
roles
.
each
{
|
(
_
,
access_type_name
)
|
set_allowed_to
(
git_operation
,
access_type_name
)
}
set_protected_branch_name
(
'master'
)
set_allowed_to
(
git_operation
,
users
.
map
(
&
:name
))
set_allowed_to
(
git_operation
,
roles
.
values
)
set_allowed_to
(
other_git_operation
)
click_on
"Protect"
...
...
@@ -35,8 +35,8 @@ RSpec.shared_examples "protected branches > access control > EE" do
click_on
"Protect"
within
(
".js-protected-branch-edit-form"
)
do
users
.
each
{
|
user
|
set_allowed_to
(
git_operation
,
user
.
name
)
}
roles
.
each
{
|
(
_
,
access_type_name
)
|
set_allowed_to
(
git_operation
,
access_type_name
)
}
set_allowed_to
(
git_operation
,
users
.
map
(
&
:name
))
set_allowed_to
(
git_operation
,
roles
.
values
)
end
wait_for_ajax
...
...
spec/features/protected_branches_spec.rb
View file @
beba1a6f
...
...
@@ -12,7 +12,9 @@ feature 'Projected Branches', feature: true, js: true do
def
set_allowed_to
(
operation
,
option
=
'Masters'
)
find
(
".js-allowed-to-
#{
operation
}
"
).
click
wait_for_ajax
click_on
option
Array
(
option
).
each
{
|
opt
|
click_on
(
opt
)
}
find
(
".js-allowed-to-
#{
operation
}
"
).
click
# needed to submit form in some cases
end
...
...
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