Skip to content
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

HaveHttpStatus uses Rack's public API #2765

Merged
merged 2 commits into from
Jun 19, 2024
Merged

Conversation

darrenboyd
Copy link
Contributor

Rack has recently changed the name of the 422 status code from unprocessable_entity to unprocessable_content. Since HaveHttpStatus was looking up the code directly through the constant in Rack, this forced developers to rename this value in their codebase in the same change upgrade Rack. Using Rack's public API method (Rack::Utils.status_code) allows users to transition from the old name to the new name on their own schedule.

This change fixes #2763

@pirj
Copy link
Member

pirj commented Jun 17, 2024

Unrelated to your PR, but the failures are caused by the lack of this check in 7.1.3.4.

I suppose we’d have to pin selenium-webdriver to ~> 4.19.0 here to fix this.

@pirj
Copy link
Member

pirj commented Jun 17, 2024

May I kindly ask you to rebase to include the fix and also add a changelog entry?

Instead of accessing a Constant that isn't a documented part of
the Rack API, get the status code for a status name using Rack's
supported public API.
@darrenboyd darrenboyd force-pushed the rack-public-api-use branch from 8d3b0f8 to b7ab320 Compare June 18, 2024 22:20
@pirj
Copy link
Member

pirj commented Jun 19, 2024

Thank you!

@pirj pirj merged commit 0bcacf6 into rspec:main Jun 19, 2024
13 of 17 checks passed
@pirj
Copy link
Member

pirj commented Jun 19, 2024

2.7/7.1 looks flaky

JonRowe added a commit that referenced this pull request Jun 19, 2024
JonRowe added a commit that referenced this pull request Jun 19, 2024
JonRowe pushed a commit that referenced this pull request Jun 19, 2024
HaveHttpStatus uses Rack's public API
JonRowe added a commit that referenced this pull request Jun 19, 2024
JonRowe added a commit that referenced this pull request Jun 19, 2024
@JonRowe
Copy link
Member

JonRowe commented Jun 19, 2024

Released in 6.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rack status code name changes breaks HttpStatusMatcher
3 participants