diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
commit | 5afcbe03ead9ada87621888a31a62652b10a7e4f (patch) | |
tree | 9918b67a0d0f0bafa6542e839a8be37adf73102d /spec/policies/global_policy_spec.rb | |
parent | c97c0201564848c1f53226fe19d71fdcc472f7d0 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'spec/policies/global_policy_spec.rb')
-rw-r--r-- | spec/policies/global_policy_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/policies/global_policy_spec.rb b/spec/policies/global_policy_spec.rb index 4fafe392aac..475e8f981dd 100644 --- a/spec/policies/global_policy_spec.rb +++ b/spec/policies/global_policy_spec.rb @@ -509,7 +509,7 @@ RSpec.describe GlobalPolicy, feature_category: :shared do end context 'when internal' do - let(:current_user) { User.ghost } + let(:current_user) { Users::Internal.ghost } it { is_expected.to be_disallowed(:use_slash_commands) } end @@ -695,4 +695,18 @@ RSpec.describe GlobalPolicy, feature_category: :shared do it { is_expected.to be_disallowed(:create_instance_runner) } end end + + describe 'create_organization' do + context 'with regular user' do + let(:current_user) { user } + + it { is_expected.to be_allowed(:create_organization) } + end + + context 'with anonymous' do + let(:current_user) { nil } + + it { is_expected.to be_disallowed(:create_organizatinon) } + end + end end |