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/controllers/products_controller_spec.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'spec/controllers') 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 -- cgit v1.2.3