diff options
Diffstat (limited to 'spec/factories/design_management')
-rw-r--r-- | spec/factories/design_management/design_at_version.rb | 6 | ||||
-rw-r--r-- | spec/factories/design_management/designs.rb | 6 | ||||
-rw-r--r-- | spec/factories/design_management/versions.rb | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/spec/factories/design_management/design_at_version.rb b/spec/factories/design_management/design_at_version.rb index b73df71595c..3d85269ee27 100644 --- a/spec/factories/design_management/design_at_version.rb +++ b/spec/factories/design_management/design_at_version.rb @@ -9,13 +9,13 @@ FactoryBot.define do version { nil } transient do - issue { design&.issue || version&.issue || create(:issue) } + issue { design&.issue || version&.issue || association(:issue) } end initialize_with do attrs = attributes.dup - attrs[:design] ||= create(:design, issue: issue) - attrs[:version] ||= create(:design_version, issue: issue) + attrs[:design] ||= association(:design, issue: issue) + attrs[:version] ||= association(:design_version, issue: issue) new(attrs) end diff --git a/spec/factories/design_management/designs.rb b/spec/factories/design_management/designs.rb index 38d0545483c..c4fb330a0da 100644 --- a/spec/factories/design_management/designs.rb +++ b/spec/factories/design_management/designs.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true FactoryBot.define do - factory :design, class: 'DesignManagement::Design' do - issue { create(:issue) } - project { issue&.project || create(:project) } + factory :design, traits: [:has_internal_id], class: 'DesignManagement::Design' do + issue { association(:issue) } + project { issue&.project || association(:project) } sequence(:filename) { |n| "homescreen-#{n}.jpg" } transient do diff --git a/spec/factories/design_management/versions.rb b/spec/factories/design_management/versions.rb index a5c0e7076e9..0233a3b567d 100644 --- a/spec/factories/design_management/versions.rb +++ b/spec/factories/design_management/versions.rb @@ -3,8 +3,8 @@ FactoryBot.define do factory :design_version, class: 'DesignManagement::Version' do sha - issue { designs.first&.issue || create(:issue) } - author { issue&.author || create(:user) } + issue { designs.first&.issue || association(:issue) } + author { issue&.author || association(:user) } transient do designs_count { 1 } |