diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-12-30 13:54:08 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-12-30 13:54:08 +0300 |
commit | c07bf1abf2a5c3751e575ee5926e9a052fa0b341 (patch) | |
tree | 6015d25af837f2269352e4d43477ea2f67e800ff /spec/policies | |
parent | e962baf4417e59cbb2ef8621ef0662f93f180f92 (diff) | |
parent | 01ed3a1511be5d2076b5f602839ca0046055dd8b (diff) |
Merge branch '34758-extend-can-create-cluster-logic' into 'master'
Allow user to add cluster when there are ancestor clusters
See merge request gitlab-org/gitlab-ce!23569
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/group_policy_spec.rb | 13 | ||||
-rw-r--r-- | spec/policies/project_policy_spec.rb | 12 |
2 files changed, 23 insertions, 2 deletions
diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb index baf21efa75c..be1804c5ce0 100644 --- a/spec/policies/group_policy_spec.rb +++ b/spec/policies/group_policy_spec.rb @@ -25,7 +25,8 @@ describe GroupPolicy do :read_cluster, :create_cluster, :update_cluster, - :admin_cluster + :admin_cluster, + :add_cluster ] end @@ -382,4 +383,14 @@ describe GroupPolicy do it { expect_disallowed(:change_share_with_group_lock) } end end + + it_behaves_like 'clusterable policies' do + let(:clusterable) { create(:group) } + let(:cluster) do + create(:cluster, + :provided_by_gcp, + :group, + groups: [clusterable]) + end + end end diff --git a/spec/policies/project_policy_spec.rb b/spec/policies/project_policy_spec.rb index 69468f9ad85..fa47b95899a 100644 --- a/spec/policies/project_policy_spec.rb +++ b/spec/policies/project_policy_spec.rb @@ -48,7 +48,7 @@ describe ProjectPolicy do update_deployment admin_project_snippet admin_project_member admin_note admin_wiki admin_project admin_commit_status admin_build admin_container_image - admin_pipeline admin_environment admin_deployment + admin_pipeline admin_environment admin_deployment add_cluster ] end @@ -465,4 +465,14 @@ describe ProjectPolicy do expect_disallowed(*maintainer_abilities) end end + + it_behaves_like 'clusterable policies' do + let(:clusterable) { create(:project, :repository) } + let(:cluster) do + create(:cluster, + :provided_by_gcp, + :project, + projects: [clusterable]) + end + end end |