diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-05 00:09:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-05 00:09:41 +0300 |
commit | b3cd77e90438a6c6e837dc27627d4c76f85ecd29 (patch) | |
tree | 52bbe45c9fd2aaceaca613bce04e7aab4a8aa07b /spec/policies | |
parent | 9bbcab8301ed38576debcb6a7f07f99005ff805a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/global_policy_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/policies/global_policy_spec.rb b/spec/policies/global_policy_spec.rb index ac7f5db980c..bd0722ce20a 100644 --- a/spec/policies/global_policy_spec.rb +++ b/spec/policies/global_policy_spec.rb @@ -6,6 +6,7 @@ describe GlobalPolicy do include TermsHelper let_it_be(:project_bot) { create(:user, :project_bot) } + let_it_be(:migration_bot) { create(:user, :migration_bot) } let(:current_user) { create(:user) } let(:user) { create(:user) } @@ -155,6 +156,12 @@ describe GlobalPolicy do it { is_expected.to be_allowed(:access_api) } end + context 'migration bot' do + let(:current_user) { migration_bot } + + it { is_expected.not_to be_allowed(:access_api) } + end + context 'when terms are enforced' do before do enforce_terms @@ -244,6 +251,12 @@ describe GlobalPolicy do it { is_expected.not_to be_allowed(:receive_notifications) } end + + context 'migration bot' do + let(:current_user) { migration_bot } + + it { is_expected.not_to be_allowed(:receive_notifications) } + end end describe 'git access' do @@ -263,6 +276,12 @@ describe GlobalPolicy do it { is_expected.to be_allowed(:access_git) } end + context 'migration bot' do + let(:current_user) { migration_bot } + + it { is_expected.to be_allowed(:access_git) } + end + describe 'deactivated user' do before do current_user.deactivate @@ -414,6 +433,12 @@ describe GlobalPolicy do it { is_expected.to be_allowed(:use_slash_commands) } end + + context 'migration bot' do + let(:current_user) { migration_bot } + + it { is_expected.not_to be_allowed(:use_slash_commands) } + end end describe 'create_snippet' do @@ -440,5 +465,11 @@ describe GlobalPolicy do it { is_expected.not_to be_allowed(:log_in) } end + + context 'migration bot' do + let(:current_user) { migration_bot } + + it { is_expected.not_to be_allowed(:log_in) } + end end end |