Commit 78464ea7 authored by Robert Speicher's avatar Robert Speicher

Fix invalid GitAccess specs for License and secondary Geo node

Due to a logic error, these specs weren't actually doing anything -- we
were running the checks on `Hash.new(Hash.new(false))`, which is just
`{}`.
parent 0afbdee0
......@@ -699,10 +699,11 @@ describe Gitlab::GitAccess do
allow(License).to receive(:block_changes?).and_return(true)
end
# All permissions are `false`
permissions_matrix = Hash.new(Hash.new(false))
# Only check admin; if an admin can't do it, other roles can't either
matrix = permissions_matrix[:admin].dup
matrix.each { |key, _| matrix[key] = false }
run_permission_checks(permissions_matrix)
run_permission_checks(admin: matrix)
end
context "when in a secondary gitlab geo node" do
......@@ -712,10 +713,11 @@ describe Gitlab::GitAccess do
allow(Gitlab::Geo).to receive(:secondary?) { true }
end
# All permissions are `false`
permissions_matrix = Hash.new(Hash.new(false))
# Only check admin; if an admin can't do it, other roles can't either
matrix = permissions_matrix[:admin].dup
matrix.each { |key, _| matrix[key] = false }
run_permission_checks(permissions_matrix)
run_permission_checks(admin: matrix)
end
describe "push_rule_check" do
......
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