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.96 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.95 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.94 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.93 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.92 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.91 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.90 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.89 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.88 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.87 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.86 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.85 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.84 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.83 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.82 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.81 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.80 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.79 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.78 spec/factories/comee/core/customer_order_items.rb
comee_core-0.1.77 spec/factories/comee/core/customer_order_items.rb