diff options
Diffstat (limited to 'spec/policies/organizations/organization_policy_spec.rb')
-rw-r--r-- | spec/policies/organizations/organization_policy_spec.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/policies/organizations/organization_policy_spec.rb b/spec/policies/organizations/organization_policy_spec.rb index 3fcfa63b1b2..7eed497d644 100644 --- a/spec/policies/organizations/organization_policy_spec.rb +++ b/spec/policies/organizations/organization_policy_spec.rb @@ -12,6 +12,7 @@ RSpec.describe Organizations::OrganizationPolicy, feature_category: :cell do let_it_be(:current_user) { nil } it { is_expected.to be_allowed(:read_organization) } + it { is_expected.to be_disallowed(:admin_organization) } end context 'when the user is an admin' do @@ -34,11 +35,13 @@ RSpec.describe Organizations::OrganizationPolicy, feature_category: :cell do create :organization_user, organization: organization, user: current_user end - it { is_expected.to be_allowed(:read_organization_user) } + it { is_expected.to be_allowed(:admin_organization) } it { is_expected.to be_allowed(:read_organization) } + it { is_expected.to be_allowed(:read_organization_user) } end context 'when the user is not part of the organization' do + it { is_expected.to be_disallowed(:admin_organization) } it { is_expected.to be_disallowed(:read_organization_user) } # All organizations are currently public, and hence they are allowed to be read # even if the user is not a part of the organization. |