Sha256: a50c4aeebf2f8bc76ce7f70845e8aaa1513406f7514f1afd7f004174088fe40a

Contents?: true

Size: 485 Bytes

Versions: 24

Compression:

Stored size: 485 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :variant_property_rule, class: 'Spree::VariantPropertyRule' do
    product

    transient do
      property { create(:property) }
      option_value { create(:option_value) }
      property_value { nil }
    end

    after(:build) do |rule, evaluator|
      rule.conditions.build(option_value: evaluator.option_value)
      rule.values.build(property: evaluator.property, value: evaluator.property_value)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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