Commit 168c8aa7 authored by Douwe Maan's avatar Douwe Maan

Expect correct error to be raised

Before, there was not actually a message for `push_code`,
so `raise_unauthorized` would be called with a `nil` argument and the
expectation would be met if any error was raised.
parent 0a4c907c
...@@ -253,16 +253,16 @@ describe Gitlab::GitAccess do ...@@ -253,16 +253,16 @@ describe Gitlab::GitAccess do
let(:actor) { :geo } let(:actor) { :geo }
it { expect { pull_changes }.not_to raise_error } it { expect { pull_changes }.not_to raise_error }
it { expect { push_changes }.to raise_unauthorized(Gitlab::GitAccess::ERROR_MESSAGES[:push_code]) } it { expect { push_changes }.to raise_unauthorized(Gitlab::GitAccess::ERROR_MESSAGES[:upload]) }
end end
private private
def push_changes(changes = Gitlab::GitAccess::ANY) def push_changes(changes = '_any')
access.check('git-receive-pack', changes) access.check('git-receive-pack', changes)
end end
def pull_changes(changes = Gitlab::GitAccess::ANY) def pull_changes(changes = '_any')
access.check('git-upload-pack', changes) access.check('git-upload-pack', changes)
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