Permalink
Browse files

test for 8018

  • Loading branch information...
1 parent 144d747 commit 92118e7732aa441e60b16bb002a7d76562ce3a88 @tenderlove tenderlove committed Dec 14, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 actionpack/test/controller/routing_test.rb
@@ -35,6 +35,17 @@ def setup
@escaped = "#{safe.join}#{hex.join}".freeze
end
+ def test_match_redirect # GH 8018
+ @set = ActionDispatch::Routing::RouteSet.new
+ @set.draw do
+ match "/myresources" => redirect("/deals"), :via => :get
+ end
+
+ assert_raises ActionController::RoutingError do
+ url_for(@set, :controller => "blargh", :action => "blargh")
+ end
+ end
+
def test_route_generation_escapes_unsafe_path_characters
assert_equal "/content/act#{@escaped}ion/var#{@escaped}iable/add#{@escaped}itional-1/add#{@escaped}itional-2",
url_for(@set, {

0 comments on commit 92118e7

Please sign in to comment.