From 9dd9d19dbee80d04d21ee8f959ab030042db5d7c Mon Sep 17 00:00:00 2001 From: Santiago Bartesaghi Date: Mon, 15 Sep 2025 17:31:21 -0300 Subject: [PATCH] Fix unprocessable_entity deprecation warning --- app/controllers/api/v1/api_controller.rb | 2 +- spec/requests/api/v1/passwords/update_spec.rb | 2 +- spec/requests/api/v1/users/create_spec.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/v1/api_controller.rb b/app/controllers/api/v1/api_controller.rb index 65edd1cf..44c1f96b 100644 --- a/app/controllers/api/v1/api_controller.rb +++ b/app/controllers/api/v1/api_controller.rb @@ -27,7 +27,7 @@ def render_record_invalid(exception) end def render_parameter_missing(exception) - render_error(exception, { message: I18n.t('api.errors.missing_param') }, :unprocessable_entity) + render_error(exception, { message: I18n.t('api.errors.missing_param') }, :unprocessable_content) end def render_error(exception, errors, status) diff --git a/spec/requests/api/v1/passwords/update_spec.rb b/spec/requests/api/v1/passwords/update_spec.rb index fea90074..70d19085 100644 --- a/spec/requests/api/v1/passwords/update_spec.rb +++ b/spec/requests/api/v1/passwords/update_spec.rb @@ -35,7 +35,7 @@ it 'does not change the password if confirmation does not match' do params[:password_confirmation] = 'anotherpass' put user_password_path, params:, headers:, as: :json - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end diff --git a/spec/requests/api/v1/users/create_spec.rb b/spec/requests/api/v1/users/create_spec.rb index f2d19b19..e310566c 100644 --- a/spec/requests/api/v1/users/create_spec.rb +++ b/spec/requests/api/v1/users/create_spec.rb @@ -51,7 +51,7 @@ it 'does not return a successful response' do subject - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end @@ -69,7 +69,7 @@ it 'does not return a successful response' do subject - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end @@ -87,7 +87,7 @@ it 'does not return a successful response' do subject - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end