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 ...@@ -699,10 +699,11 @@ describe Gitlab::GitAccess do
allow(License).to receive(:block_changes?).and_return(true) allow(License).to receive(:block_changes?).and_return(true)
end end
# All permissions are `false` # Only check admin; if an admin can't do it, other roles can't either
permissions_matrix = Hash.new(Hash.new(false)) matrix = permissions_matrix[:admin].dup
matrix.each { |key, _| matrix[key] = false }
run_permission_checks(permissions_matrix) run_permission_checks(admin: matrix)
end end
context "when in a secondary gitlab geo node" do context "when in a secondary gitlab geo node" do
...@@ -712,10 +713,11 @@ describe Gitlab::GitAccess do ...@@ -712,10 +713,11 @@ describe Gitlab::GitAccess do
allow(Gitlab::Geo).to receive(:secondary?) { true } allow(Gitlab::Geo).to receive(:secondary?) { true }
end end
# All permissions are `false` # Only check admin; if an admin can't do it, other roles can't either
permissions_matrix = Hash.new(Hash.new(false)) matrix = permissions_matrix[:admin].dup
matrix.each { |key, _| matrix[key] = false }
run_permission_checks(permissions_matrix) run_permission_checks(admin: matrix)
end end
describe "push_rule_check" do 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