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
Boxiang Sun
gitlab-ce
Commits
84af3ceb
Commit
84af3ceb
authored
Dec 26, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for developers can push to protected branches.
parent
92eb3974
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+24
-0
No files found.
spec/lib/gitlab/git_access_spec.rb
View file @
84af3ceb
...
...
@@ -129,6 +129,13 @@ describe Gitlab::GitAccess do
}
end
def
self
.
updated_permissions_matrix
updated_permissions_matrix
=
permissions_matrix
.
dup
updated_permissions_matrix
[
:developer
][
:push_protected_branch
]
=
true
updated_permissions_matrix
[
:developer
][
:push_all
]
=
true
updated_permissions_matrix
end
permissions_matrix
.
keys
.
each
do
|
role
|
describe
"
#{
role
}
access"
do
before
{
protect_feature_branch
}
...
...
@@ -143,5 +150,22 @@ describe Gitlab::GitAccess do
end
end
end
context
"with enabled developers push to protected branches "
do
updated_permissions_matrix
.
keys
.
each
do
|
role
|
describe
"
#{
role
}
access"
do
before
{
create
(
:protected_branch
,
name:
'feature'
,
developers_can_push:
true
,
project:
project
)
}
before
{
project
.
team
<<
[
user
,
role
]
}
updated_permissions_matrix
[
role
].
each
do
|
action
,
allowed
|
context
action
do
subject
{
access
.
push_access_check
(
user
,
project
,
changes
[
action
])
}
it
{
subject
.
allowed?
.
should
allowed
?
be_true
:
be_false
}
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