Sha256: 0f25e58d69c52018b9c69e2a4ca56cf5a274aed027010ac5e54949331b8d2ac5

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

FactoryGirl.define do
  factory :gemgento_product_attribute_set, class: 'Gemgento::ProductAttributeSet'  do
    name 'default attribute set'

    factory :gemgento_product_attribute_set_with_attributes do
      after(:create) do |attribute_set|
        attribute_set.product_attributes << Gemgento::ProductAttribute.new(code: 'price', frontend_input: 'price')

        # giftvoucher attributes
        attribute_set.product_attributes << Gemgento::ProductAttribute.new(code: 'gift_price_type', frontend_input: 'text')
        attribute_set.product_attributes << Gemgento::ProductAttribute.new(code: 'gift_price', frontend_input: 'price')
        attribute_set.product_attributes << Gemgento::ProductAttribute.new(code: 'gift_value', frontend_input: 'price')

        # special price attributes
        attribute_set.product_attributes << Gemgento::ProductAttribute.new(code: 'special_price', frontend_input: 'price')
        attribute_set.product_attributes << Gemgento::ProductAttribute.new(code: 'special_from_date', frontend_input: 'price')
        attribute_set.product_attributes << Gemgento::ProductAttribute.new(code: 'special_to_date', frontend_input: 'price')
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemgento-2.8.0 spec/factories/gemgento/product_attribute_sets.rb