提交 9cff2484 编写于 作者: A Aaron Patterson

only call methods that are on the superclass

We want to treat the response object as if it's a real response object
(not a test object), so we should only call methods that are on the
superclass.
上级 368b9938
......@@ -318,7 +318,7 @@ def test_server_error_response_code
def test_missing_response_code
process :response404
assert @response.missing?
assert @response.not_found?
end
def test_client_error_response_code
......@@ -346,7 +346,7 @@ def test_redirection
def test_successful_response_code
process :nothing
assert @response.success?
assert @response.successful?
end
def test_response_object
......
......@@ -819,7 +819,7 @@ def test_a_rescuing_around_action
response = test_process(RescuedController)
end
assert response.success?
assert response.successful?
assert_equal("I rescued this: #<FilterTest::ErrorToRescue: Something made the bad noise.>", response.body)
end
......
......@@ -11,10 +11,9 @@ def assert_response_code_range(range, predicate)
end
test "helpers" do
assert_response_code_range 200..299, :success?
assert_response_code_range [404], :missing?
assert_response_code_range 300..399, :redirect?
assert_response_code_range 500..599, :error?
assert_response_code_range 200..299, :successful?
assert_response_code_range [404], :not_found?
assert_response_code_range 300..399, :redirection?
assert_response_code_range 500..599, :server_error?
assert_response_code_range 400..499, :client_error?
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册