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/controllers | |
parent | 717fa996842012a8666bcff985218c2abddd9991 (diff) |
Añade spec de products_controller#show
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/products_controller_spec.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/controllers/products_controller_spec.rb b/spec/controllers/products_controller_spec.rb index d4f1373..aabab4b 100644 --- a/spec/controllers/products_controller_spec.rb +++ b/spec/controllers/products_controller_spec.rb @@ -3,11 +3,15 @@ require 'rails_helper' RSpec.describe Api::ProductsController, type: :controller do - let(:product) { create(:product) } - it { should route(:post, '/api/products').to(action: :create) } - it { should route(:put, "/api/products#{product.public_id}").to(action: :update, id: product.public_id) } + it do + should route(:put, '/api/products/0439733420a4c5a3e8239bb1').to(action: :update, id: '0439733420a4c5a3e8239bb1') + end it { should route(:get, '/api/products').to(action: :index) } - it { should route(:get, "/api/products/#{product.public_id}").to(action: :show, id: product.public_id) } - it { should route(:delete, "/api/products/#{product.public_id}").to(action: :destroy, id: product.public_id) } + it do + should route(:get, '/api/products/0439733420a4c5a3e8239bb1').to(action: :show, id: '0439733420a4c5a3e8239bb1') + end + it do + should route(:delete, '/api/products/0439733420a4c5a3e8239bb1').to(action: :destroy, id: '0439733420a4c5a3e8239bb1') + end end |