Sha256: 65a8aba7cb12b5e1e2e9b59112f0cace6a182f6842b9b239224977e39a9a21fb

Contents?: true

Size: 464 Bytes

Versions: 44

Compression:

Stored size: 464 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 }
    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

44 entries across 44 versions & 1 rubygems

Version Path
comee_core-0.1.56 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.55 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.54 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.53 spec/factories/comee/core/customer_order_items.rb