Skip to content

Commit

Permalink
Fix tests for status code change on Rack HEAD
Browse files Browse the repository at this point in the history
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]: rack/rack@64ad26e
  • Loading branch information
skipkayhil committed Dec 11, 2023
1 parent c80fa6a commit eed1cb2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eed1cb2

Please sign in to comment.