diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 18:38:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 18:38:24 +0000 |
commit | 983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch) | |
tree | b153cd387c14ba23bd5a07514c7c01fddf6a78a0 /spec/policies | |
parent | a2bddee2cdb38673df0e004d5b32d9f77797de64 (diff) | |
download | gitlab-ce-983a0bba5d2a042c4a3bbb22432ec192c7501d82.tar.gz |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/global_policy_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/policies/global_policy_spec.rb b/spec/policies/global_policy_spec.rb index 2d261241486..5e77b64a408 100644 --- a/spec/policies/global_policy_spec.rb +++ b/spec/policies/global_policy_spec.rb @@ -5,6 +5,7 @@ require 'spec_helper' describe GlobalPolicy do include TermsHelper + let_it_be(:project_bot) { create(:user, :project_bot) } let(:current_user) { create(:user) } let(:user) { create(:user) } @@ -120,6 +121,12 @@ describe GlobalPolicy do it { is_expected.to be_allowed(:access_api) } end + context 'project bot' do + let(:current_user) { project_bot } + + it { is_expected.to be_allowed(:access_api) } + end + context 'when terms are enforced' do before do enforce_terms @@ -203,6 +210,12 @@ describe GlobalPolicy do it { is_expected.not_to be_allowed(:receive_notifications) } end + + context 'project bot' do + let(:current_user) { project_bot } + + it { is_expected.not_to be_allowed(:receive_notifications) } + end end describe 'git access' do @@ -265,6 +278,12 @@ describe GlobalPolicy do it { is_expected.to be_allowed(:access_git) } end end + + context 'project bot' do + let(:current_user) { project_bot } + + it { is_expected.to be_allowed(:access_git) } + end end describe 'read instance metadata' do @@ -361,6 +380,12 @@ describe GlobalPolicy do it { is_expected.not_to be_allowed(:use_slash_commands) } end + + context 'project bot' do + let(:current_user) { project_bot } + + it { is_expected.to be_allowed(:use_slash_commands) } + end end describe 'create_snippet' do @@ -380,4 +405,12 @@ describe GlobalPolicy do it { is_expected.not_to be_allowed(:create_snippet) } end end + + describe 'log in' do + context 'project bot' do + let(:current_user) { project_bot } + + it { is_expected.not_to be_allowed(:log_in) } + end + end end |