Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-23 06:06:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-23 06:06:01 +0300
commit8c7eab92cd0009f55cb999bbade43e0f969c137e (patch)
tree180cac6632448a211ddbe555191574c98e8dc385 /spec/support/controllers
parentdffeff5520e861dc6e7319b690c573186bbbd22e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/controllers')
-rw-r--r--spec/support/controllers/authorization_helpers.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/support/controllers/authorization_helpers.rb b/spec/support/controllers/authorization_helpers.rb
new file mode 100644
index 00000000000..e1786e0ca8a
--- /dev/null
+++ b/spec/support/controllers/authorization_helpers.rb
@@ -0,0 +1,6 @@
+# frozen_string_literal: true
+
+def forbid_controller_ability!(ability)
+ allow(controller).to receive(:can?).and_call_original
+ allow(controller).to receive(:can?).with(anything, ability, any_args).and_return(false)
+end