summaryrefslogtreecommitdiff
path: root/spec/factories
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-04-06 14:53:02 -0600
committerHombreLaser <sebastian-440@live.com>2023-04-06 14:53:02 -0600
commit61110336bc5a924346f0654cb5bb812101c3bc7a (patch)
treed51511956e1246819c2480a4f3c30b6074bfe7ad /spec/factories
parentfc191f53503629087fd453e626ec2a4c58e0a21b (diff)
Añade specs de cxarts_controller
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/cart.rb7
-rw-r--r--spec/factories/product_cart.rb9
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