Commit 7a650d15 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'backport-git-access-spec-changes' into 'master'

Backport git access spec changes from EE

https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/645#note_16391185

See merge request !6961
parents f0c7e671 cc6d4286
...@@ -185,6 +185,7 @@ describe Gitlab::GitAccess, lib: true do ...@@ -185,6 +185,7 @@ describe Gitlab::GitAccess, lib: true do
end end
end end
# Run permission checks for a user
def self.run_permission_checks(permissions_matrix) def self.run_permission_checks(permissions_matrix)
permissions_matrix.keys.each do |role| permissions_matrix.keys.each do |role|
describe "#{role} access" do describe "#{role} access" do
...@@ -194,13 +195,12 @@ describe Gitlab::GitAccess, lib: true do ...@@ -194,13 +195,12 @@ describe Gitlab::GitAccess, lib: true do
else else
project.team << [user, role] project.team << [user, role]
end end
end
permissions_matrix[role].each do |action, allowed|
context action do
subject { access.push_access_check(changes[action]) }
it { expect(subject.allowed?).to allowed ? be_truthy : be_falsey } permissions_matrix[role].each do |action, allowed|
context action do
subject { access.push_access_check(changes[action]) }
it { expect(subject.allowed?).to allowed ? be_truthy : be_falsey }
end
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment