diff options
Diffstat (limited to 'spec/factories/work_items/related_link_restrictions.rb')
-rw-r--r-- | spec/factories/work_items/related_link_restrictions.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/factories/work_items/related_link_restrictions.rb b/spec/factories/work_items/related_link_restrictions.rb new file mode 100644 index 00000000000..c0e4f188b5f --- /dev/null +++ b/spec/factories/work_items/related_link_restrictions.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :related_link_restriction, class: 'WorkItems::RelatedLinkRestriction' do + source_type { association :work_item_type, :default } + target_type { association :work_item_type, :default } + link_type { 0 } + + initialize_with do + WorkItems::RelatedLinkRestriction + .find_or_initialize_by(source_type: source_type, target_type: target_type, link_type: link_type) + end + end +end |