Sha256: 5166882686f5dd8fc25bb72febfa6e486450c4d5f05733a7196c671c0628af06

Contents?: true

Size: 383 Bytes

Versions: 6

Compression:

Stored size: 383 Bytes

Contents

FactoryBot.define do
  factory :haystack_tag, class: "NeedleInAHaystack::HaystackTag" do
    sequence(:name) { |n| "Tag #{n}" }
    sequence(:description) { |n| "Description #{n}" }

    trait :root do
      name { "root" }
      description { "Root tag" }
      parent_tag { nil }
    end

    trait :child do
      association :parent_tag, factory: :haystack_tag
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
needle_in_a_haystack-1.0.5 spec/factories/haystack_tags.rb
needle_in_a_haystack-1.0.4 spec/factories/haystack_tags.rb
needle_in_a_haystack-1.0.3 spec/factories/haystack_tags.rb
needle_in_a_haystack-1.0.2 spec/factories/haystack_tags.rb
needle_in_a_haystack-1.0.1 spec/factories/haystack_tags.rb
needle_in_a_haystack-1.0.0 spec/factories/haystack_tags.rb