From 61110336bc5a924346f0654cb5bb812101c3bc7a Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Thu, 6 Apr 2023 14:53:02 -0600 Subject: AƱade specs de cxarts_controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/factories/cart.rb | 7 +++++++ spec/factories/product_cart.rb | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 spec/factories/cart.rb create mode 100644 spec/factories/product_cart.rb (limited to 'spec/factories') 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 -- cgit v1.2.3