diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-12-04 15:38:15 -0600 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-12-24 10:28:40 -0600 |
commit | 01ed3a1511be5d2076b5f602839ca0046055dd8b (patch) | |
tree | e4f825cfb92c1a2fd470ac3fb3f50ededdeebbd2 /spec/policies/project_policy_spec.rb | |
parent | 4a10c813e726d09216c534bb0ad0ae50a0400259 (diff) | |
download | gitlab-ce-01ed3a1511be5d2076b5f602839ca0046055dd8b.tar.gz |
Allow users to add cluster with ancestors
Include a new policy in Clusterables
(projects and groups), which checks if another cluster
can be added
clusterable_has_cluster? and multiple_clusters_available
private methods will be overriden in EE
Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/34758
Diffstat (limited to 'spec/policies/project_policy_spec.rb')
-rw-r--r-- | spec/policies/project_policy_spec.rb | 12 |
1 files changed, 11 insertions, 1 deletions
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 |