Skip to content

Commit

Permalink
Update test results for changes to rescuable exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Oct 7, 2023
1 parent 7253aa0 commit d0d0e4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
26 changes: 14 additions & 12 deletions test/controllers/api/changesets_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,14 @@ def test_create_invalid_no_content

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

##
Expand Down Expand Up @@ -361,13 +363,13 @@ def test_close_method_invalid

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

##
Expand Down
6 changes: 3 additions & 3 deletions test/controllers/diary_entries_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,9 @@ def test_show
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)
Expand Down

0 comments on commit d0d0e4d

Please sign in to comment.