Sha256: 56c82668e4eaa4dae6e7921463f9958e68b893f8f696cd2fa059c0fcffc98f90

Contents?: true

Size: 501 Bytes

Versions: 15

Compression:

Stored size: 501 Bytes

Contents

FactoryBot.define do
  factory :customer_order_item, class: "Comee::Core::CustomerOrderItem" do
    customer_order
    product
    unit
    customer_item_no { Faker::Alphanumeric.alpha(number: 10) }
    quantity { 1 }
    price { 1.5 }
    total_price { quantity * price }
    delivery_date { Date.current }
    canceled { false }

    trait :with_inventory do
      after(:create) do |item|
        create(:inventory, product: item.product, quantity: item.quantity + 100)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
comee_core-0.2.11 spec/factories/comee/core/customer_order_items.rb
comee_core-0.2.10 spec/factories/comee/core/customer_order_items.rb
comee_core-0.2.9 spec/factories/comee/core/customer_order_items.rb
comee_core-0.2.8 spec/factories/comee/core/customer_order_items.rb
comee_core-0.2.7 spec/factories/comee/core/customer_order_items.rb
comee_core-0.2.6 spec/factories/comee/core/customer_order_items.rb
comee_core-0.2.5 spec/factories/comee/core/customer_order_items.rb
comee_core-0.2.4 spec/factories/comee/core/customer_order_items.rb
comee_core-0.2.3 spec/factories/comee/core/customer_order_items.rb
comee_core-0.2.2 spec/factories/comee/core/customer_order_items.rb
comee_core-0.2.1 spec/factories/comee/core/customer_order_items.rb
comee_core-0.2.0 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.99 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.98 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.97 spec/factories/comee/core/customer_order_items.rb