mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
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:
@@ -417,7 +417,7 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
|
||||
:headers => credentials('admin'))
|
||||
end
|
||||
|
||||
assert_response :unprocessable_entity
|
||||
assert_response :unprocessable_content
|
||||
assert_equal 'application/xml', @response.media_type
|
||||
assert_select 'errors error', :text => "First name cannot be blank"
|
||||
end
|
||||
@@ -434,7 +434,7 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
|
||||
:headers => credentials('admin'))
|
||||
end
|
||||
|
||||
assert_response :unprocessable_entity
|
||||
assert_response :unprocessable_content
|
||||
assert_equal 'application/json', @response.media_type
|
||||
json = ActiveSupport::JSON.decode(response.body)
|
||||
assert_kind_of Hash, json
|
||||
@@ -503,7 +503,7 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
|
||||
:headers => credentials('admin'))
|
||||
end
|
||||
|
||||
assert_response :unprocessable_entity
|
||||
assert_response :unprocessable_content
|
||||
assert_equal 'application/xml', @response.media_type
|
||||
assert_select 'errors error', :text => "First name cannot be blank"
|
||||
end
|
||||
@@ -521,7 +521,7 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
|
||||
:headers => credentials('admin'))
|
||||
end
|
||||
|
||||
assert_response :unprocessable_entity
|
||||
assert_response :unprocessable_content
|
||||
assert_equal 'application/json', @response.media_type
|
||||
json = ActiveSupport::JSON.decode(response.body)
|
||||
assert_kind_of Hash, json
|
||||
|
||||
Reference in New Issue
Block a user