提交 b0e5fc27 编写于 作者: R Rafael França

Merge pull request #22514 from prathamesh-sonpatki/use-assert-over-assert-predicate

Use assert over assert_predicate in assert_response
......@@ -31,7 +31,7 @@ def assert_response(type, message = nil)
if Symbol === type
if [:success, :missing, :redirect, :error].include?(type)
assert_predicate @response, RESPONSE_PREDICATES[type], message
assert @response.send(RESPONSE_PREDICATES[type]), message
else
code = Rack::Utils::SYMBOL_TO_STATUS_CODE[type]
if code.nil?
......
......@@ -70,8 +70,8 @@ def test_message_when_response_is_redirect_but_asserted_for_status_other_than_re
assert_response :success
end
expected = "Expected response to be a <success>, but was a redirect to <http://test.host/posts/redirect/1>."
assert_match expected, error.message
expected = "Expected response to be a <success>, but was a redirect to <http://test.host/posts/redirect/1>"
assert_equal expected, error.message
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册