From 3e106dc7f5fbd6961c67f41aea66033c27b5142f Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Sat, 18 Mar 2023 12:15:43 -0600 Subject: AƱade spec de products_controller#show MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/models/product_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec/models') diff --git a/spec/models/product_spec.rb b/spec/models/product_spec.rb index b3790fe..d9d0c64 100644 --- a/spec/models/product_spec.rb +++ b/spec/models/product_spec.rb @@ -10,4 +10,11 @@ RSpec.describe Product, type: :model do it { should have_one_attached(:picture) } it { should belong_to(:company) } it { should serialize(:categories) } + + describe '#to_param' do + it "describes the param the product's routes expect" do + product = create(:product, public_id: SecureRandom.hex(12)) + expect(product.to_param).to eq(product.public_id) + end + end end -- cgit v1.2.3