From eed1cb25edc6e046857ec9239258dec7c7765311 Mon Sep 17 00:00:00 2001 From: Hartley McGuire Date: Mon, 11 Dec 2023 01:11:33 -0500 Subject: [PATCH] Fix tests for status code change on Rack HEAD Rack was recently [updated][1] with a deprecation for some status codes that have been renamed (most notably, Unprocessable Entity was renamed to Unprocessable Content). Since the deprecation was only added to the `#status_code` method, this has caused test failures for some tests that depend on the `SYMBOLS_TO_STATUS_CODE` hash. This commit replaces the usage of `SYMBOLS_TO_STATUS_CODE` with `#status_code` so that we get the deprecation message instead of a test failure. [1]: https://github.com/rack/rack/commit/64ad26e3381da2ce1853638a2c4ea241c2ad3729 --- actionpack/lib/action_dispatch/testing/assertion_response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/lib/action_dispatch/testing/assertion_response.rb b/actionpack/lib/action_dispatch/testing/assertion_response.rb index 79af372cc19c0..4363fc868a361 100644 --- a/actionpack/lib/action_dispatch/testing/assertion_response.rb +++ b/actionpack/lib/action_dispatch/testing/assertion_response.rb @@ -36,7 +36,7 @@ def code_and_name private def code_from_name(name) - GENERIC_RESPONSE_CODES[name] || Rack::Utils::SYMBOL_TO_STATUS_CODE[name] + GENERIC_RESPONSE_CODES[name] || Rack::Utils.status_code(name) end def name_from_code(code)