summaryrefslogtreecommitdiff
path: root/spec/factories/clusters
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-07-17 11:32:04 +1200
committerThong Kuah <tkuah@gitlab.com>2019-07-19 09:53:56 +1200
commit88bf3fe8b4c07d38b331fc1d72487ba2b351395c (patch)
tree7d0b4859ac72f10b35078c9faa648773b27942bd /spec/factories/clusters
parentddf2dcf7fdad69135cee590307773b255d2fe0b5 (diff)
downloadgitlab-ce-88bf3fe8b4c07d38b331fc1d72487ba2b351395c.tar.gz
Adds cluster_for_group factory for convienencegroup_with_cluster_factory
Also means we don't have to resort to an update statement to set parent for child groups who also have clusters. This is much shorter than ``` create(:cluster, :provided_by_gcp, :group, groups: [group]) ```
Diffstat (limited to 'spec/factories/clusters')
-rw-r--r--spec/factories/clusters/clusters.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/factories/clusters/clusters.rb b/spec/factories/clusters/clusters.rb
index ab332fc238b..171f5256d2b 100644
--- a/spec/factories/clusters/clusters.rb
+++ b/spec/factories/clusters/clusters.rb
@@ -5,6 +5,8 @@ FactoryBot.define do
cluster_type :project_type
managed true
+ factory :cluster_for_group, traits: [:provided_by_gcp, :group]
+
trait :instance do
cluster_type { Clusters::Cluster.cluster_types[:instance_type] }
end