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/cards_controller | |
parent | 3afd35371caa0677fd2f66491bd337d1673013dc (diff) |
Mejora presentaciĆ³n de mensajes de error
Diffstat (limited to 'spec/requests/cards_controller')
-rw-r--r-- | spec/requests/cards_controller/create_spec.rb | 10 | ||||
-rw-r--r-- | spec/requests/cards_controller/update_spec.rb | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/spec/requests/cards_controller/create_spec.rb b/spec/requests/cards_controller/create_spec.rb index 465288b..af04a23 100644 --- a/spec/requests/cards_controller/create_spec.rb +++ b/spec/requests/cards_controller/create_spec.rb @@ -15,11 +15,11 @@ RSpec.describe 'POST /account/cards', type: :request do it_behaves_like 'a POST request' do let(:route) { '/api/account/cards' } let(:expected_error_messages) do - ['Number is the wrong length (should be 16 characters)', - 'Expiration year must be greater than 1970', - 'Expiration month is not included in the list', - 'Expiration day is not included in the list', - "Security code can't be blank"] + ['is the wrong length (should be 16 characters)', + 'must be greater than 1970', + 'is not included in the list', + 'is not included in the list', + "can't be blank"] end let(:desired_error_status) { 422 } let(:expected_text) do diff --git a/spec/requests/cards_controller/update_spec.rb b/spec/requests/cards_controller/update_spec.rb index 77b4c4f..453befc 100644 --- a/spec/requests/cards_controller/update_spec.rb +++ b/spec/requests/cards_controller/update_spec.rb @@ -17,11 +17,11 @@ RSpec.describe 'PUT /api/account/addresses', type: :request do let(:route) { "/api/account/cards/#{card.id}" } let(:wrong_route) { "/api/account/cards/#{SecureRandom.hex(8)}" } let(:expected_error_messages) do - ['Number is the wrong length (should be 16 characters)', - 'Expiration year must be greater than 1970', - 'Expiration month is not included in the list', - 'Expiration day is not included in the list', - "Security code can't be blank"] + ['is the wrong length (should be 16 characters)', + 'must be greater than 1970', + 'is not included in the list', + 'is not included in the list', + "can't be blank"] end let(:expected_text) do [new_card.number, new_card.expiration_year, new_card.expiration_month, new_card.expiration_day, |