diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-07-08 11:45:02 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-07-29 15:20:39 +0530 |
commit | 828f6eb6e50e6193fad9dbdd95d9dd56506e4064 (patch) | |
tree | 9a328d1698606d81c0bb7000ed68a4d01891f3f0 /spec/lib/gitlab/user_access_spec.rb | |
parent | ab6096c17261605d835a4a8edae21f31d90026df (diff) | |
download | gitlab-ce-828f6eb6e50e6193fad9dbdd95d9dd56506e4064.tar.gz |
Enforce "No One Can Push" during git operations.
1. The crux of this change is in `UserAccess`, which looks through all
the access levels, asking each if the user has access to push/merge
for the current project.
2. Update the `protected_branches` factory to create access levels as
necessary.
3. Fix and augment `user_access` and `git_access` specs.
Diffstat (limited to 'spec/lib/gitlab/user_access_spec.rb')
-rw-r--r-- | spec/lib/gitlab/user_access_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/lib/gitlab/user_access_spec.rb b/spec/lib/gitlab/user_access_spec.rb index aa9ec243498..5bb095366fa 100644 --- a/spec/lib/gitlab/user_access_spec.rb +++ b/spec/lib/gitlab/user_access_spec.rb @@ -44,7 +44,7 @@ describe Gitlab::UserAccess, lib: true do describe 'push to protected branch if allowed for developers' do before do - @branch = create :protected_branch, project: project, developers_can_push: true + @branch = create :protected_branch, :developers_can_push, project: project end it 'returns true if user is a master' do @@ -65,7 +65,7 @@ describe Gitlab::UserAccess, lib: true do describe 'merge to protected branch if allowed for developers' do before do - @branch = create :protected_branch, project: project, developers_can_merge: true + @branch = create :protected_branch, :developers_can_merge, project: project end it 'returns true if user is a master' do |