Skip to content

Commit

Permalink
Merge pull request #2765 from darrenboyd/rack-public-api-use
Browse files Browse the repository at this point in the history
HaveHttpStatus uses Rack's public API
  • Loading branch information
pirj authored and JonRowe committed Jun 19, 2024
1 parent 4e8c259 commit c6a3d83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,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

0 comments on commit c6a3d83

Please sign in to comment.