-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Rack status code name changes breaks HttpStatusMatcher #2763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Nice catch. Would you like to submit a PR? |
@pirj @darrenboyd Shouldn't we actually ask developers to use the actual changed status code name as per rack-utils, instead of supporting the old name? |
This is how the public rack api behaves. Who knows, might be they’ll decide to change the status back? How would you interpret the definition of the “symbol to status code” as referenced from the assert_response mapping description in Rails guides? |
For what it's worth, Rack just follows the specifications as defined by various RFCs.
From hyperium/http#664. |
The simplest possible PR is here: @sarvesh-sankaranarayanan, yeah, I tend to prefer encouraging people to move forward with changes like this. However, this change is more about using Rack's API in a better way. It looks like the Rack developers are going to add a deprecation warning for this change, and then force people to move over a future version. |
Nice work team! |
related: rspec/rspec-rails#2763
Rack status code name changes breaks HttpStatusMatcher: rspec/rspec-rails#2763
:unprocessable_entity is now :unprocessable_content rspec/rspec-rails#2763
:unprocessable_entity is now :unprocessable_content rspec/rspec-rails#2763
:unprocessable_entity is now :unprocessable_content rspec/rspec-rails#2763
:unprocessable_entity is now :unprocessable_content rspec/rspec-rails#2763
:unprocessable_entity is now :unprocessable_content rspec/rspec-rails#2763
* ➕ Upgrade Sidekiq to 7.3.9 The previous version used to crash with the following error: undefined method `broadcast' for class ActiveSupport::Logger * Send email when job application state is updated For a given list of states, each time the job application state changes, we send an email to the applicant to notify them and to remind them that they may have actions to do. * Send email when job application is rejected For a given list of rejection states, each time the job application state changes, we send an email to the applicant to notify them that the application has been rejected. * ✅ Fix unprocessable entity Rack status code name changes breaks HttpStatusMatcher: rspec/rspec-rails#2763
What Ruby, Rails and RSpec versions are you using?
Ruby version: 3.3.3
Rails version: 7.1.3.4
RSpec version: 3.13.0
Rack version: 3.1.3
Observed behaviour
Rack has recently changed the name of the 422 status code from
unprocessable_entity
tounprocessable_content
. However, both names will still resolve if Rack's public API is being used. However, theHttpStatusMatcher
is looking at the Rack Constant directly, instead of using the provided API.My suggestion is for the code in
have_http_status.rb
that looks like (around line 218)...be changed to....
Here's the behavior of the
Rack::Utils.status_code
method...The text was updated successfully, but these errors were encountered: