Skip to content

Commit 9cff248

Browse files
committed
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.
1 parent 368b993 commit 9cff248

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

actionpack/test/controller/action_pack_assertions_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def test_server_error_response_code
318318

319319
def test_missing_response_code
320320
process :response404
321-
assert @response.missing?
321+
assert @response.not_found?
322322
end
323323

324324
def test_client_error_response_code
@@ -346,7 +346,7 @@ def test_redirection
346346

347347
def test_successful_response_code
348348
process :nothing
349-
assert @response.success?
349+
assert @response.successful?
350350
end
351351

352352
def test_response_object

actionpack/test/controller/filters_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ def test_a_rescuing_around_action
819819
response = test_process(RescuedController)
820820
end
821821

822-
assert response.success?
822+
assert response.successful?
823823
assert_equal("I rescued this: #<FilterTest::ErrorToRescue: Something made the bad noise.>", response.body)
824824
end
825825

actionpack/test/dispatch/test_response_test.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ def assert_response_code_range(range, predicate)
1111
end
1212

1313
test "helpers" do
14-
assert_response_code_range 200..299, :success?
15-
assert_response_code_range [404], :missing?
16-
assert_response_code_range 300..399, :redirect?
17-
assert_response_code_range 500..599, :error?
14+
assert_response_code_range 200..299, :successful?
15+
assert_response_code_range [404], :not_found?
16+
assert_response_code_range 300..399, :redirection?
1817
assert_response_code_range 500..599, :server_error?
1918
assert_response_code_range 400..499, :client_error?
2019
end

0 commit comments

Comments
 (0)