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/products_controller/create_spec.rb | 4 ++-- spec/requests/products_controller/update_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'spec/requests/products_controller') 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 -- cgit v1.2.3