diff options
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/cart.rb | 7 | ||||
-rw-r--r-- | spec/factories/product_cart.rb | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/spec/factories/cart.rb b/spec/factories/cart.rb new file mode 100644 index 0000000..e184181 --- /dev/null +++ b/spec/factories/cart.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :cart, class: 'Cart' do + user_account { create(:user_account) } + end +end diff --git a/spec/factories/product_cart.rb b/spec/factories/product_cart.rb new file mode 100644 index 0000000..713fd0a --- /dev/null +++ b/spec/factories/product_cart.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :product_cart, class: 'ProductCart' do + cart { create(:cart) } + product { create(:product) } + quantity { rand(1..1000) } + end +end |