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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Bug Fixes:

* Reset `ActiveSupport::CurrentAttributes` between examples. (Javier Julio, #2752)
* Fix a broken link in generated mailer previews. (Chiara Núñez, #2764)
* Have HttpStatusMatcher use Rack's public API for http status code. (Darren Boyd, #2763)

### 6.1.2 / 2024-03-19
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.1.1...v6.1.2)
Expand Down
6 changes: 1 addition & 5 deletions lib/rspec/rails/matchers/have_http_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,7 @@ def pp_status(status, code)
# @see Rack::Utils::SYMBOL_TO_STATUS_CODE
# @raise [ArgumentError] if an associated code could not be found
def set_expected_code!
@expected ||=
Rack::Utils::SYMBOL_TO_STATUS_CODE.fetch(expected_status) do
raise ArgumentError,
"Invalid HTTP status: #{expected_status.inspect}"
end
@expected ||= Rack::Utils.status_code(expected_status)
end
end

Expand Down
Loading