diff options
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 |