summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-04-04 20:45:51 -0600
committerHombreLaser <sebastian-440@live.com>2023-04-04 20:45:51 -0600
commitd520e6d9717d8a64e870930d08218eb30d803690 (patch)
tree7f3008bdab0e84119e8e20211db435a0770df539
parent7dd7989bba156dc2e790ff6daa9df31cfa0ed7cd (diff)
Añade specs de Cart, ProductCart
-rw-r--r--spec/models/cart_spec.rb4
-rw-r--r--spec/models/product_cart_spec.rb3
-rw-r--r--spec/models/user_account_spec.rb1
3 files changed, 6 insertions, 2 deletions
diff --git a/spec/models/cart_spec.rb b/spec/models/cart_spec.rb
index 5985277..8f8016c 100644
--- a/spec/models/cart_spec.rb
+++ b/spec/models/cart_spec.rb
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'rails_helper'
RSpec.describe Cart, type: :model do
- pending "add some examples to (or delete) #{__FILE__}"
+ it { should have_one(:user_account) }
end
diff --git a/spec/models/product_cart_spec.rb b/spec/models/product_cart_spec.rb
index 7a1a676..5a300b8 100644
--- a/spec/models/product_cart_spec.rb
+++ b/spec/models/product_cart_spec.rb
@@ -1,5 +1,6 @@
require 'rails_helper'
RSpec.describe ProductCart, type: :model do
- pending "add some examples to (or delete) #{__FILE__}"
+ it { should belong_to(:product) }
+ it { should belong_to(:cart) }
end
diff --git a/spec/models/user_account_spec.rb b/spec/models/user_account_spec.rb
index 6466fe8..a8365e6 100644
--- a/spec/models/user_account_spec.rb
+++ b/spec/models/user_account_spec.rb
@@ -2,6 +2,7 @@ require 'rails_helper'
RSpec.describe UserAccount, type: :model do
it { should have_secure_password }
+ it { should have_one(:cart) }
it { should validate_presence_of(:email) }
it { should validate_presence_of(:first_name) }
it { should validate_presence_of(:last_name) }