From 26b40a7a38ced56998a4316ac0d21374c6080d6b Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Tue, 14 Mar 2023 20:18:28 -0600 Subject: AƱade spec de Product MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/models/product_spec.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'spec') 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 -- cgit v1.2.3