diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-29 18:11:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-29 18:11:56 +0300 |
commit | 37066217ce3827f60baac3669d07318da74aa36a (patch) | |
tree | 2063919e687b7e2f423bebd04f9e510c4db230e8 /spec/policies | |
parent | 27f6da0ab2b8f1945a78709c7b5d540a6cc400fd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/group_policy_spec.rb | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb index 201ccf0fc14..fc4fbace790 100644 --- a/spec/policies/group_policy_spec.rb +++ b/spec/policies/group_policy_spec.rb @@ -11,8 +11,8 @@ RSpec.describe GroupPolicy do it do expect_allowed(:read_group) - expect_allowed(:read_organization) - expect_allowed(:read_contact) + expect_allowed(:read_crm_organization) + expect_allowed(:read_crm_contact) expect_allowed(:read_counts) expect_allowed(*read_group_permissions) expect_disallowed(:upload_file) @@ -33,8 +33,8 @@ RSpec.describe GroupPolicy do end it { expect_disallowed(:read_group) } - it { expect_disallowed(:read_organization) } - it { expect_disallowed(:read_contact) } + it { expect_disallowed(:read_crm_organization) } + it { expect_disallowed(:read_crm_contact) } it { expect_disallowed(:read_counts) } it { expect_disallowed(*read_group_permissions) } end @@ -48,8 +48,8 @@ RSpec.describe GroupPolicy do end it { expect_disallowed(:read_group) } - it { expect_disallowed(:read_organization) } - it { expect_disallowed(:read_contact) } + it { expect_disallowed(:read_crm_organization) } + it { expect_disallowed(:read_crm_contact) } it { expect_disallowed(:read_counts) } it { expect_disallowed(*read_group_permissions) } end @@ -933,8 +933,8 @@ RSpec.describe GroupPolicy do it { is_expected.to be_allowed(:read_package) } it { is_expected.to be_allowed(:read_group) } - it { is_expected.to be_allowed(:read_organization) } - it { is_expected.to be_allowed(:read_contact) } + it { is_expected.to be_allowed(:read_crm_organization) } + it { is_expected.to be_allowed(:read_crm_contact) } it { is_expected.to be_disallowed(:create_package) } end @@ -944,8 +944,8 @@ RSpec.describe GroupPolicy do it { is_expected.to be_allowed(:create_package) } it { is_expected.to be_allowed(:read_package) } it { is_expected.to be_allowed(:read_group) } - it { is_expected.to be_allowed(:read_organization) } - it { is_expected.to be_allowed(:read_contact) } + it { is_expected.to be_allowed(:read_crm_organization) } + it { is_expected.to be_allowed(:read_crm_contact) } it { is_expected.to be_disallowed(:destroy_package) } end @@ -1032,4 +1032,17 @@ RSpec.describe GroupPolicy do it { is_expected.to be_disallowed(:update_runners_registration_token) } end end + + context 'with customer_relations feature flag disabled' do + let(:current_user) { owner } + + before do + stub_feature_flags(customer_relations: false) + end + + it { is_expected.to be_disallowed(:read_crm_contact) } + it { is_expected.to be_disallowed(:read_crm_organization) } + it { is_expected.to be_disallowed(:admin_crm_contact) } + it { is_expected.to be_disallowed(:admin_crm_organization) } + end end |