summaryrefslogtreecommitdiff
path: root/spec/models/product_spec.rb
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-03-14 20:18:28 -0600
committerHombreLaser <sebastian-440@live.com>2023-03-14 20:18:28 -0600
commit26b40a7a38ced56998a4316ac0d21374c6080d6b (patch)
tree3f06ff55c398409189e155403e398a2cd038942b /spec/models/product_spec.rb
parent5fec2e990709c971153855d28d8bc927d20e817b (diff)
Añade spec de Product
Diffstat (limited to 'spec/models/product_spec.rb')
-rw-r--r--spec/models/product_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/models/product_spec.rb b/spec/models/product_spec.rb
index f22fbfd..b3790fe 100644
--- a/spec/models/product_spec.rb
+++ b/spec/models/product_spec.rb
@@ -1,5 +1,13 @@
+# frozen_string_literal: true
+
require 'rails_helper'
RSpec.describe Product, type: :model do
- pending "add some examples to (or delete) #{__FILE__}"
+ it { should validate_presence_of(:name) }
+ it { should validate_presence_of(:unitary_price) }
+ it { should validate_presence_of(:bulk_price) }
+ it { should validate_presence_of(:available_quantity) }
+ it { should have_one_attached(:picture) }
+ it { should belong_to(:company) }
+ it { should serialize(:categories) }
end