rex/spec/factories/orders.rb

13 lines
308 B
Ruby
Raw Normal View History

2023-10-28 14:06:03 +02:00
# frozen_string_literal: true
FactoryBot.define do
2023-11-08 20:33:49 +01:00
factory :order, class: Rex::Book::Order do
2023-10-28 14:06:03 +02:00
sequence(:id) { |i| i }
sequence(:user_id) { |i| i }
sequence(:is_buy) { |i| (i % 2).zero? }
sequence(:price) { 100 }
sequence(:quantity) { 20 }
remaining_quantity { quantity }
2023-10-28 14:06:03 +02:00
end
end