summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/git_access_spec.rb
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-01-19 13:04:14 +0000
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-02-06 13:35:35 +0000
commit32b2ff26011a5274bdb8a3dd41ad360a67c3148a (patch)
tree56064e3de4e9ca505730bdf1af3597ba8ead499f /spec/lib/gitlab/git_access_spec.rb
parent35882e681b681f68a818bda9a8d2624edfecc219 (diff)
downloadgitlab-ce-32b2ff26011a5274bdb8a3dd41ad360a67c3148a.tar.gz
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.rb20
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