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
454c88ae
Commit
454c88ae
authored
Jul 28, 2016
by
Timothy Andrew
Committed by
Alfredo Sumaran
Aug 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix protected branches feature spec.
To work with restricting access to a specific user.
parent
f7547d81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
6 deletions
+68
-6
spec/features/protected_branches_spec.rb
spec/features/protected_branches_spec.rb
+68
-6
No files found.
spec/features/protected_branches_spec.rb
View file @
454c88ae
...
@@ -113,9 +113,11 @@ feature 'Projected Branches', feature: true, js: true do
...
@@ -113,9 +113,11 @@ feature 'Projected Branches', feature: true, js: true do
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
within
(
".protected-branches-list"
)
do
within
(
".protected-branches-list"
)
{
click_on
"Settings"
}
find
(
".js-allowed-to-push"
).
click
within
(
'.js-allowed-to-push-container'
)
{
click_on
access_type_name
}
within
(
".allowed-to-push-container"
)
do
find
(
".allowed-to-push"
).
click
click_on
access_type_name
end
end
wait_for_ajax
wait_for_ajax
...
@@ -148,14 +150,74 @@ feature 'Projected Branches', feature: true, js: true do
...
@@ -148,14 +150,74 @@ feature 'Projected Branches', feature: true, js: true do
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
within
(
".protected-branches-list"
)
do
within
(
".protected-branches-list"
)
{
click_on
"Settings"
}
find
(
".js-allowed-to-merge"
).
click
within
(
'.js-allowed-to-merge-container'
)
{
click_on
access_type_name
}
within
(
".allowed-to-merge-container"
)
do
find
(
".allowed-to-merge"
).
click
click_on
access_type_name
end
end
wait_for_ajax
wait_for_ajax
expect
(
ProtectedBranch
.
last
.
merge_access_levels
.
map
(
&
:access_level
)).
to
include
(
access_type_id
)
expect
(
ProtectedBranch
.
last
.
merge_access_levels
.
map
(
&
:access_level
)).
to
include
(
access_type_id
)
end
end
end
end
context
"while restricting access to a specific user"
do
let
(
:authorized_user
)
{
create
(
:user
)
}
before
{
project
.
team
<<
[
authorized_user
,
:developer
]
}
[
'push'
,
'merge'
].
each
do
|
git_operation_type
|
it
"allows creating protected branches that a specific user can
#{
git_operation_type
}
to"
do
visit
namespace_project_protected_branches_path
(
project
.
namespace
,
project
)
set_protected_branch_name
(
'master'
)
within
(
'.new_protected_branch'
)
do
find
(
".allowed-to-
#{
git_operation_type
}
"
).
click
click_on
authorized_user
.
name
end
perform_enqueued_jobs
{
click_on
"Protect"
}
within
(
".protected-branches-list"
)
{
click_on
"Settings"
}
within
(
".protected-branch-
#{
git_operation_type
}
-access-list"
)
do
expect
(
page
).
to
have_content
(
authorized_user
.
name
)
end
end
it
"allows updating a protected branch so that a specific user can
#{
git_operation_type
}
to it"
do
visit
namespace_project_protected_branches_path
(
project
.
namespace
,
project
)
set_protected_branch_name
(
'master'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
click_on
"Settings"
}
within
(
".allowed-to-
#{
git_operation_type
}
-container"
)
do
find
(
".allowed-to-
#{
git_operation_type
}
"
).
click
perform_enqueued_jobs
{
click_on
authorized_user
.
name
}
end
within
(
".protected-branch-
#{
git_operation_type
}
-access-list"
)
do
expect
(
page
).
to
have_content
(
authorized_user
.
name
)
end
end
it
"allows deleting a user-specific access level"
do
visit
namespace_project_protected_branches_path
(
project
.
namespace
,
project
)
set_protected_branch_name
(
'master'
)
within
(
'.new_protected_branch'
)
do
find
(
".allowed-to-
#{
git_operation_type
}
"
).
click
click_on
authorized_user
.
name
end
click_on
"Protect"
within
(
".protected-branches-list"
)
{
click_on
"Settings"
}
within
(
".protected-branch-
#{
git_operation_type
}
-access-list"
)
do
perform_enqueued_jobs
{
click_link
"Delete"
}
end
expect
(
page
).
to
have_content
(
"Successfully deleted."
)
end
end
end
end
end
end
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