Tweak FactoryBot definition for clusters
Only create an associated project or group if there were none already specified.
This commit is contained in:
parent
98a14a498d
commit
42c6ccd209
1 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ FactoryBot.define do
|
|||
cluster_type { Clusters::Cluster.cluster_types[:project_type] }
|
||||
|
||||
before(:create) do |cluster, evaluator|
|
||||
cluster.projects << create(:project, :repository)
|
||||
cluster.projects << create(:project, :repository) unless cluster.projects.present?
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -20,7 +20,7 @@ FactoryBot.define do
|
|||
cluster_type { Clusters::Cluster.cluster_types[:group_type] }
|
||||
|
||||
before(:create) do |cluster, evalutor|
|
||||
cluster.groups << create(:group)
|
||||
cluster.groups << create(:group) unless cluster.groups.present?
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue