RoutingError is now UrlGenerationError
This commit is contained in:
parent
6c51b3cc0a
commit
321f8cecdc
5 changed files with 16 additions and 16 deletions
|
@ -131,10 +131,10 @@ class BrowseControllerTest < ActionController::TestCase
|
||||||
# then we check that we get the correct 404 when a non-existant id is passed
|
# 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
|
# then we check that it will get a successful response, when we do pass an id
|
||||||
def browse_check(type, id)
|
def browse_check(type, id)
|
||||||
assert_raise ActionController::RoutingError do
|
assert_raise ActionController::UrlGenerationError do
|
||||||
get type
|
get type
|
||||||
end
|
end
|
||||||
assert_raise ActionController::RoutingError do
|
assert_raise ActionController::UrlGenerationError do
|
||||||
get type, {:id => -10} # we won't have an id that's negative
|
get type, {:id => -10} # we won't have an id that's negative
|
||||||
end
|
end
|
||||||
get type, {:id => id}
|
get type, {:id => id}
|
||||||
|
|
|
@ -175,7 +175,7 @@ class ChangesetControllerTest < ActionController::TestCase
|
||||||
begin
|
begin
|
||||||
get :read, :id => id
|
get :read, :id => id
|
||||||
assert_response :not_found, "should get a not found"
|
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
|
assert_match /No route matches/, ex.to_s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -241,7 +241,7 @@ class ChangesetControllerTest < ActionController::TestCase
|
||||||
begin
|
begin
|
||||||
put :close, :id => id
|
put :close, :id => id
|
||||||
assert_response :unauthorized, "Shouldn't be able close the non-existant changeset #{id}, when not authorized"
|
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
|
assert_match /No route matches/, ex.to_s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -252,7 +252,7 @@ class ChangesetControllerTest < ActionController::TestCase
|
||||||
begin
|
begin
|
||||||
put :close, :id => id
|
put :close, :id => id
|
||||||
assert_response :not_found, "The changeset #{id} doesn't exist, so can't be closed"
|
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
|
assert_match /No route matches/, ex.to_s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -130,7 +130,7 @@ class MessageControllerTest < ActionController::TestCase
|
||||||
assert_equal true, Message.find(messages(:unread_message).id).message_read
|
assert_equal true, Message.find(messages(:unread_message).id).message_read
|
||||||
|
|
||||||
# Asking to reply to a message with no ID should fail
|
# Asking to reply to a message with no ID should fail
|
||||||
assert_raise ActionController::RoutingError do
|
assert_raise ActionController::UrlGenerationError do
|
||||||
get :reply
|
get :reply
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ class MessageControllerTest < ActionController::TestCase
|
||||||
assert_equal true, Message.find(messages(:unread_message).id).message_read
|
assert_equal true, Message.find(messages(:unread_message).id).message_read
|
||||||
|
|
||||||
# Asking to read a message with no ID should fail
|
# Asking to read a message with no ID should fail
|
||||||
assert_raise ActionController::RoutingError do
|
assert_raise ActionController::UrlGenerationError do
|
||||||
get :read
|
get :read
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ class MessageControllerTest < ActionController::TestCase
|
||||||
assert_equal false, Message.find(messages(:unread_message).id).message_read
|
assert_equal false, Message.find(messages(:unread_message).id).message_read
|
||||||
|
|
||||||
# Asking to mark a message with no ID should fail
|
# Asking to mark a message with no ID should fail
|
||||||
assert_raise ActionController::RoutingError do
|
assert_raise ActionController::UrlGenerationError do
|
||||||
post :mark
|
post :mark
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ class MessageControllerTest < ActionController::TestCase
|
||||||
assert_equal true, m.to_user_visible
|
assert_equal true, m.to_user_visible
|
||||||
|
|
||||||
# Asking to delete a message with no ID should fail
|
# Asking to delete a message with no ID should fail
|
||||||
assert_raise ActionController::RoutingError do
|
assert_raise ActionController::UrlGenerationError do
|
||||||
post :delete
|
post :delete
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ class OldNodeControllerTest < ActionController::TestCase
|
||||||
def check_not_found_id_version(id, version)
|
def check_not_found_id_version(id, version)
|
||||||
get :version, :id => id, :version => version
|
get :version, :id => id, :version => version
|
||||||
assert_response :not_found
|
assert_response :not_found
|
||||||
rescue ActionController::RoutingError => ex
|
rescue ActionController::UrlGenerationError => ex
|
||||||
assert_match /No route matches/, ex.to_s
|
assert_match /No route matches/, ex.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ class UserBlocksControllerTest < ActionController::TestCase
|
||||||
# test the show action
|
# test the show action
|
||||||
def test_show
|
def test_show
|
||||||
# Viewing a block should fail when no ID is given
|
# Viewing a block should fail when no ID is given
|
||||||
assert_raise ActionController::RoutingError do
|
assert_raise ActionController::UrlGenerationError do
|
||||||
get :show
|
get :show
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ class UserBlocksControllerTest < ActionController::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
# We should get an error if no user is specified
|
# We should get an error if no user is specified
|
||||||
assert_raise ActionController::RoutingError do
|
assert_raise ActionController::UrlGenerationError do
|
||||||
get :edit
|
get :edit
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -311,7 +311,7 @@ class UserBlocksControllerTest < ActionController::TestCase
|
||||||
assert_equal "Vandalism", b.reason
|
assert_equal "Vandalism", b.reason
|
||||||
|
|
||||||
# We should get an error if no block ID is specified
|
# We should get an error if no block ID is specified
|
||||||
assert_raise ActionController::RoutingError do
|
assert_raise ActionController::UrlGenerationError do
|
||||||
put :update
|
put :update
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ class UserBlocksControllerTest < ActionController::TestCase
|
||||||
assert_in_delta Time.now, b.ends_at, 1
|
assert_in_delta Time.now, b.ends_at, 1
|
||||||
|
|
||||||
# We should get an error if no block ID is specified
|
# We should get an error if no block ID is specified
|
||||||
assert_raise ActionController::RoutingError do
|
assert_raise ActionController::UrlGenerationError do
|
||||||
get :revoke
|
get :revoke
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ class UserBlocksControllerTest < ActionController::TestCase
|
||||||
# test the blocks_on action
|
# test the blocks_on action
|
||||||
def test_blocks_on
|
def test_blocks_on
|
||||||
# Asking for a list of blocks with no user name should fail
|
# 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
|
get :blocks_on
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -411,7 +411,7 @@ class UserBlocksControllerTest < ActionController::TestCase
|
||||||
# test the blocks_by action
|
# test the blocks_by action
|
||||||
def test_blocks_by
|
def test_blocks_by
|
||||||
# Asking for a list of blocks with no user name should fail
|
# 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
|
get :blocks_by
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue