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