diff options
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 |