# then we check that we get the correct 404 when a non-existant id is passed
# then we check that it will get a successful response, when we do pass an id
def browse_check(type, id)
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
get type
end
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
get type, {:id => -10} # we won't have an id that's negative
end
get type, {:id => id}
begin
get :read, :id => id
assert_response :not_found, "should get a not found"
- rescue ActionController::RoutingError => ex
+ rescue ActionController::UrlGenerationError => ex
assert_match /No route matches/, ex.to_s
end
end
begin
put :close, :id => id
assert_response :unauthorized, "Shouldn't be able close the non-existant changeset #{id}, when not authorized"
- rescue ActionController::RoutingError => ex
+ rescue ActionController::UrlGenerationError => ex
assert_match /No route matches/, ex.to_s
end
end
begin
put :close, :id => id
assert_response :not_found, "The changeset #{id} doesn't exist, so can't be closed"
- rescue ActionController::RoutingError => ex
+ rescue ActionController::UrlGenerationError => ex
assert_match /No route matches/, ex.to_s
end
end
assert_equal true, Message.find(messages(:unread_message).id).message_read
# Asking to reply to a message with no ID should fail
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
get :reply
end
assert_equal true, Message.find(messages(:unread_message).id).message_read
# Asking to read a message with no ID should fail
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
get :read
end
assert_equal false, Message.find(messages(:unread_message).id).message_read
# Asking to mark a message with no ID should fail
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
post :mark
end
assert_equal true, m.to_user_visible
# Asking to delete a message with no ID should fail
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
post :delete
end
def check_not_found_id_version(id, version)
get :version, :id => id, :version => version
assert_response :not_found
- rescue ActionController::RoutingError => ex
+ rescue ActionController::UrlGenerationError => ex
assert_match /No route matches/, ex.to_s
end
# test the show action
def test_show
# Viewing a block should fail when no ID is given
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
get :show
end
end
# We should get an error if no user is specified
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
get :edit
end
assert_equal "Vandalism", b.reason
# We should get an error if no block ID is specified
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
put :update
end
assert_in_delta Time.now, b.ends_at, 1
# We should get an error if no block ID is specified
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
get :revoke
end
# test the blocks_on action
def test_blocks_on
# Asking for a list of blocks with no user name should fail
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
get :blocks_on
end
# test the blocks_by action
def test_blocks_by
# Asking for a list of blocks with no user name should fail
- assert_raise ActionController::RoutingError do
+ assert_raise ActionController::UrlGenerationError do
get :blocks_by
end