diff options
author | HombreLaser <sebastian-440@live.com> | 2023-03-18 12:15:43 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2023-03-18 12:15:43 -0600 |
commit | 3e106dc7f5fbd6961c67f41aea66033c27b5142f (patch) | |
tree | 1cc3c2046a506e8d0bba7cfa300c8d0734cce6ae /spec/models | |
parent | 717fa996842012a8666bcff985218c2abddd9991 (diff) |
Añade spec de products_controller#show
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/product_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 |