diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-01-19 16:04:14 +0300 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-02-06 16:35:35 +0300 |
commit | 32b2ff26011a5274bdb8a3dd41ad360a67c3148a (patch) | |
tree | 56064e3de4e9ca505730bdf1af3597ba8ead499f /spec/lib/gitlab/git_access_spec.rb | |
parent | 35882e681b681f68a818bda9a8d2624edfecc219 (diff) |
Adds remote messsage when project is created in a push over SSH or HTTP
Diffstat (limited to 'spec/lib/gitlab/git_access_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git_access_spec.rb | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb index 2009a8ac48c..457e219c1a5 100644 --- a/spec/lib/gitlab/git_access_spec.rb +++ b/spec/lib/gitlab/git_access_spec.rb @@ -501,15 +501,17 @@ describe Gitlab::GitAccess do end aggregate_failures do - matrix.each do |action, allowed| - check = -> { access.send(:check_push_access!, changes[action]) } - - if allowed - expect(&check).not_to raise_error, - -> { "expected #{action} to be allowed" } - else - expect(&check).to raise_error(Gitlab::GitAccess::UnauthorizedError), - -> { "expected #{action} to be disallowed" } + Gitlab::GitAccess::ALL_COMMANDS.each do |cmd| + matrix.each do |action, allowed| + check = -> { access.send(:check_push_access!, cmd, changes[action]) } + + if allowed + expect(&check).not_to raise_error, + -> { "expected #{action} to be allowed" } + else + expect(&check).to raise_error(Gitlab::GitAccess::UnauthorizedError), + -> { "expected #{action} to be disallowed" } + end end end end |