From db9b4b712271a67e60e6c0bf58c9ce510f177682 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Tue, 4 Apr 2023 17:55:20 -0600 Subject: Mejora presentaciĆ³n de mensajes de error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/requests/addresses_controller/create_spec.rb | 3 +-- spec/requests/addresses_controller/update_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'spec/requests/addresses_controller') 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, -- cgit v1.2.3