diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-23 06:06:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-23 06:06:01 +0300 |
commit | 8c7eab92cd0009f55cb999bbade43e0f969c137e (patch) | |
tree | 180cac6632448a211ddbe555191574c98e8dc385 /spec/support/controllers | |
parent | dffeff5520e861dc6e7319b690c573186bbbd22e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/controllers')
-rw-r--r-- | spec/support/controllers/authorization_helpers.rb | 6 |
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 |