Sha256: 6638ecf1e96aaa7d7fb4e7c5e6af94c39477eecb8c47cff3e9057598b5b07c5f

Contents?: true

Size: 444 Bytes

Versions: 23

Compression:

Stored size: 444 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :taxon, class: 'Spree::Taxon' do
    name { 'Ruby on Rails' }
    taxonomy_id { (parent&.taxonomy || create(:taxonomy)).id }
    parent_id { parent&.id || taxonomy.root.id }

    trait :with_icon do
      after(:create) do |taxon|
        taxon.update(icon: Spree::Core::Engine.root.join('lib', 'spree', 'testing_support', 'fixtures', 'blank.jpg').open)
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
solidus_core-4.4.1 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.4.0 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.3.4 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.2.4 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.1.5 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.3.3 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.3.2 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.1.4 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.3.1 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.3.0 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.2.3 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.1.3 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.0.4 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.0.3 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.1.2 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.2.2 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.2.1 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.2.0 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.1.1 lib/spree/testing_support/factories/taxon_factory.rb
solidus_core-4.0.2 lib/spree/testing_support/factories/taxon_factory.rb