Skip to content

Commit ef3fd60

Browse files
author
Sam Phippen
committed
Ensure response codes in tests are integers.
In rails 5 this was somehow making it through as a string, but this `to_i` call simply fixes that.
1 parent 86ed5ac commit ef3fd60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rspec/rails/matchers/have_http_status.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def initialize(code)
8585
# @return [Boolean] `true` if the numeric code matched the `response` code
8686
def matches?(response)
8787
test_response = as_test_response(response)
88-
@actual = test_response.response_code
88+
@actual = test_response.response_code.to_i
8989
expected == @actual
9090
rescue TypeError => _ignored
9191
@invalid_response = response

0 commit comments

Comments
 (0)