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/addresses_controller | |
parent | 3afd35371caa0677fd2f66491bd337d1673013dc (diff) |
Mejora presentaciĆ³n de mensajes de error
Diffstat (limited to 'spec/requests/addresses_controller')
-rw-r--r-- | spec/requests/addresses_controller/create_spec.rb | 3 | ||||
-rw-r--r-- | spec/requests/addresses_controller/update_spec.rb | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/spec/requests/addresses_controller/create_spec.rb b/spec/requests/addresses_controller/create_spec.rb index befb80b..5987e0f 100644 --- a/spec/requests/addresses_controller/create_spec.rb +++ b/spec/requests/addresses_controller/create_spec.rb @@ -15,8 +15,7 @@ RSpec.describe 'POST /account/addresses', type: :request do it_behaves_like 'a POST request' do let(:route) { '/api/account/addresses' } let(:expected_error_messages) do - ["Number can't be blank", "Street can't be blank", "Zip code can't be blank", - 'Country is invalid', "City can't be blank"] + ["can't be blank", "can't be blank", "can't be blank", 'is invalid', "can't be blank"] end let(:desired_error_status) { 422 } let(:expected_text) { [address.number.to_s, address.zip_code.to_s, address.country, address.street, address.city] } diff --git a/spec/requests/addresses_controller/update_spec.rb b/spec/requests/addresses_controller/update_spec.rb index 0c3662e..a5b993a 100644 --- a/spec/requests/addresses_controller/update_spec.rb +++ b/spec/requests/addresses_controller/update_spec.rb @@ -21,8 +21,8 @@ RSpec.describe 'PUT /api/account/addresses', type: :request do let(:route) { "/api/account/addresses/#{address.id}" } let(:wrong_route) { "/api/account/addresses/#{SecureRandom.hex(8)}" } let(:expected_error_messages) do - ["Number can't be blank", "Street can't be blank", "Zip code can't be blank", - 'Country is invalid', "City can't be blank"] + ["can't be blank", "can't be blank", "can't be blank", + 'is invalid', "can't be blank"] end let(:expected_text) do [new_address.number.to_s, new_address.zip_code.to_s, new_address.country, new_address.street, |