From b803bddb1f32842b0a5ec93640778d902b5f7999 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Wed, 12 Jun 2024 16:09:37 +0000 Subject: Fix "ArgumentError: Invalid response name: unprocessable_entity" with Rack 3.1.0+ in assert_response (#39889). Rack 3.1.0 changed the symbol for HTTP status code 422 from `:unprocessable_entity` to `:unprocessable_content`. Due to the change, `assert_response(:unprocessable_entity, ...)` raises ArgumentError with Rack 3.1.0+. This fix is a follow-up to r22837. git-svn-id: https://svn.redmine.org/redmine/trunk@22876 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 51ea2e2fd..d7d588eb3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -766,7 +766,7 @@ class ApplicationController < ActionController::Base def render_api_errors(*messages) @error_messages = messages.flatten - render :template => 'common/error_messages', :format => [:api], :status => :unprocessable_entity, :layout => nil + render :template => 'common/error_messages', :format => [:api], :status => :unprocessable_content, :layout => nil end # Overrides #_include_layout? so that #render with no arguments -- cgit v1.2.3