diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-07-24 12:20:54 +0300 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-07-25 10:35:06 +0300 |
commit | 1ce5bcacdbf56682e05fa63875203bf4d10584bc (patch) | |
tree | d46baea2e6f30ff63553f76624fe0b314227a732 /spec/policies | |
parent | ba997f3c428d94adfc9a2eb4eb0daaa3d759c4df (diff) |
Remove code related to object hierarchy in MySQL
These are not required because MySQL is not
supported anymore
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/group_member_policy_spec.rb | 2 | ||||
-rw-r--r-- | spec/policies/group_policy_spec.rb | 59 |
2 files changed, 3 insertions, 58 deletions
diff --git a/spec/policies/group_member_policy_spec.rb b/spec/policies/group_member_policy_spec.rb index 7bd7184cffe..a4f3301a064 100644 --- a/spec/policies/group_member_policy_spec.rb +++ b/spec/policies/group_member_policy_spec.rb @@ -58,7 +58,7 @@ describe GroupMemberPolicy do end end - context 'with the group parent', :postgresql do + context 'with the group parent' do let(:current_user) { create :user } let(:subgroup) { create(:group, :private, parent: group)} diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb index dc3675a7b9e..be55d94daec 100644 --- a/spec/policies/group_policy_spec.rb +++ b/spec/policies/group_policy_spec.rb @@ -51,7 +51,7 @@ describe GroupPolicy do it { expect_allowed(:read_label, :read_list) } - context 'in subgroups', :nested_groups do + context 'in subgroups' do let(:subgroup) { create(:group, :private, parent: group) } let(:project) { create(:project, namespace: subgroup) } @@ -104,8 +104,6 @@ describe GroupPolicy do end it 'allows every maintainer permission plus creating subgroups' do - allow(Group).to receive(:supports_nested_objects?).and_return(true) - create_subgroup_permission = [:create_subgroup] updated_maintainer_permissions = maintainer_permissions + create_subgroup_permission @@ -122,8 +120,6 @@ describe GroupPolicy do context 'with subgroup_creation_level set to owner' do it 'allows every maintainer permission' do - allow(Group).to receive(:supports_nested_objects?).and_return(true) - expect_allowed(*guest_permissions) expect_allowed(*reporter_permissions) expect_allowed(*developer_permissions) @@ -137,8 +133,6 @@ describe GroupPolicy do let(:current_user) { owner } it do - allow(Group).to receive(:supports_nested_objects?).and_return(true) - expect_allowed(*guest_permissions) expect_allowed(*reporter_permissions) expect_allowed(*developer_permissions) @@ -151,8 +145,6 @@ describe GroupPolicy do let(:current_user) { admin } it do - allow(Group).to receive(:supports_nested_objects?).and_return(true) - expect_allowed(*guest_permissions) expect_allowed(*reporter_permissions) expect_allowed(*developer_permissions) @@ -161,52 +153,7 @@ describe GroupPolicy do end end - describe 'when nested group support feature is disabled' do - before do - allow(Group).to receive(:supports_nested_objects?).and_return(false) - end - - context 'admin' do - let(:current_user) { admin } - - it 'allows every owner permission except creating subgroups' do - create_subgroup_permission = [:create_subgroup] - updated_owner_permissions = - owner_permissions - create_subgroup_permission - - expect_disallowed(*create_subgroup_permission) - expect_allowed(*updated_owner_permissions) - end - end - - context 'owner' do - let(:current_user) { owner } - - it 'allows every owner permission except creating subgroups' do - create_subgroup_permission = [:create_subgroup] - updated_owner_permissions = - owner_permissions - create_subgroup_permission - - expect_disallowed(*create_subgroup_permission) - expect_allowed(*updated_owner_permissions) - end - end - - context 'maintainer' do - let(:current_user) { maintainer } - - it 'allows every maintainer permission except creating subgroups' do - create_subgroup_permission = [:create_subgroup] - updated_maintainer_permissions = - maintainer_permissions - create_subgroup_permission - - expect_disallowed(*create_subgroup_permission) - expect_allowed(*updated_maintainer_permissions) - end - end - end - - describe 'private nested group use the highest access level from the group and inherited permissions', :nested_groups do + describe 'private nested group use the highest access level from the group and inherited permissions' do let(:nested_group) do create(:group, :private, :owner_subgroup_creation_only, parent: group) end @@ -289,8 +236,6 @@ describe GroupPolicy do let(:current_user) { owner } it do - allow(Group).to receive(:supports_nested_objects?).and_return(true) - expect_allowed(*guest_permissions) expect_allowed(*reporter_permissions) expect_allowed(*developer_permissions) |