Update test results for changes to rescuable exception handling

https://github.com/rails/rails/pull/45867
This commit is contained in:
Tom Hughes 2023-10-07 11:44:38 +01:00
parent 3e3873a7c2
commit 45be62391f
2 changed files with 17 additions and 15 deletions

View file

@ -134,12 +134,14 @@ module Api
def test_create_wrong_method
auth_header = basic_authorization_header create(:user).email, "test"
assert_raise ActionController::RoutingError do
get changeset_create_path, :headers => auth_header
end
assert_raise ActionController::RoutingError do
post changeset_create_path, :headers => auth_header
end
get changeset_create_path, :headers => auth_header
assert_response :not_found
assert_template "rescues/routing_error"
post changeset_create_path, :headers => auth_header
assert_response :not_found
assert_template "rescues/routing_error"
end
##
@ -361,13 +363,13 @@ module Api
auth_header = basic_authorization_header user.email, "test"
assert_raise ActionController::RoutingError do
get changeset_close_path(changeset), :headers => auth_header
end
get changeset_close_path(changeset), :headers => auth_header
assert_response :not_found
assert_template "rescues/routing_error"
assert_raise ActionController::RoutingError do
post changeset_close_path(changeset), :headers => auth_header
end
post changeset_close_path(changeset), :headers => auth_header
assert_response :not_found
assert_template "rescues/routing_error"
end
##

View file

@ -695,9 +695,9 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest
assert_template :show
# Try a non-integer ID
assert_raise ActionController::RoutingError do
get "/user/#{CGI.escape(user.display_name)}/diary/#{diary_entry.id})"
end
get "/user/#{CGI.escape(user.display_name)}/diary/#{diary_entry.id})"
assert_response :not_found
assert_template "rescues/routing_error"
# Try a deleted entry
diary_entry_deleted = create(:diary_entry, :user => user, :visible => false)