diff options
author | HombreLaser <sebastian-440@live.com> | 2023-04-04 17:55:20 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2023-04-04 17:55:20 -0600 |
commit | db9b4b712271a67e60e6c0bf58c9ce510f177682 (patch) | |
tree | 791da60f29a1ac3b73efff46493d96c0116318e0 /spec/requests/products_controller | |
parent | 3afd35371caa0677fd2f66491bd337d1673013dc (diff) |
Mejora presentaciĆ³n de mensajes de error
Diffstat (limited to 'spec/requests/products_controller')
-rw-r--r-- | spec/requests/products_controller/create_spec.rb | 4 | ||||
-rw-r--r-- | spec/requests/products_controller/update_spec.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/requests/products_controller/create_spec.rb b/spec/requests/products_controller/create_spec.rb index 400fd18..4d6a9bc 100644 --- a/spec/requests/products_controller/create_spec.rb +++ b/spec/requests/products_controller/create_spec.rb @@ -17,8 +17,8 @@ RSpec.describe 'POST /api/products', type: :request do let(:headers) { { 'CONTENT_TYPE' => 'application/json', 'Authorization' => "Bearer #{token['token']}" } } let(:route) { '/api/products' } let(:expected_error_messages) do - ["Name can't be blank", 'Unitary price must be greater than 0', 'Bulk price must be greater than 0', - 'Available quantity must be greater than 0', 'Company must exist'] + ["can't be blank", 'must be greater than 0', 'must be greater than 0', + 'must be greater than 0', 'must exist'] end let(:desired_error_status) { 422 } let(:expected_text) do diff --git a/spec/requests/products_controller/update_spec.rb b/spec/requests/products_controller/update_spec.rb index f916d6a..c84c5bd 100644 --- a/spec/requests/products_controller/update_spec.rb +++ b/spec/requests/products_controller/update_spec.rb @@ -19,8 +19,8 @@ RSpec.describe 'PUT /api/products/product_id', type: :request do let(:route) { "/api/products/#{product.public_id}" } let(:wrong_route) { "/api/products/#{SecureRandom.hex(8)}" } let(:expected_error_messages) do - ["Name can't be blank", 'Unitary price must be greater than 0', 'Bulk price must be greater than 0', - 'Available quantity must be greater than 0', 'Company must exist'] + ["can't be blank", 'must be greater than 0', 'must be greater than 0', + 'must be greater than 0', 'must exist'] end let(:desired_error_status) { 422 } let(:expected_text) do |