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
This commit is contained in:
Go MAEDA
2024-06-12 16:09:37 +00:00
parent e41bc39322
commit b803bddb1f
33 changed files with 56 additions and 55 deletions

View File

@@ -120,7 +120,7 @@ class Redmine::ApiTest::VersionsTest < Redmine::ApiTest::Base
:params => {:version => {:name => ''}},
:headers => credentials('jsmith'))
end
assert_response :unprocessable_entity
assert_response :unprocessable_content
assert_select 'errors error', :text => "Name cannot be blank"
end