Sha256: eae68a1f4685839f2505a77cf99e00aae5ca421e5324ce90ff401f942e05eb97

Contents?: true

Size: 666 Bytes

Versions: 48

Compression:

Stored size: 666 Bytes

Contents

# frozen_string_literal: true

require 'spree/testing_support/factories/product_factory'
require 'spree/testing_support/factories/property_factory'
require 'spree/testing_support/factories/option_value_factory'

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

48 entries across 48 versions & 2 rubygems

Version Path
solidus_core-2.10.5 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.11.3 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.11.2 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.11.1 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.10.3 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.11.0 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.10.2 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.9.6 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.8.6 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.10.1 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.9.5 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.10.0 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.9.4 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.6.6 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.7.4 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.8.5 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.9.3 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.9.2 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.10.0.beta1 lib/spree/testing_support/factories/variant_property_rule_factory.rb
solidus_core-2.7.3 lib/spree/testing_support/factories/variant_property_rule_factory.rb