diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/route_inspect_test.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/railties/test/application/route_inspect_test.rb b/railties/test/application/route_inspect_test.rb index 31af1ca6dc..3b8c874b5b 100644 --- a/railties/test/application/route_inspect_test.rb +++ b/railties/test/application/route_inspect_test.rb @@ -155,11 +155,14 @@ module ApplicationTests def test_redirect output = draw do - match '/foo' => redirect("/bar") - match '/foo2' => redirect("/bar", status: 307) + get "/foo" => redirect("/foo/bar"), :constraints => { :subdomain => "admin" } + get "/bar" => redirect(path: "/foo/bar", status: 307) + get "/foobar" => redirect{ "/foo/bar" } end - assert_equal " foo /foo(.:format) Redirect (301)", output[0] - assert_equal "foo2 /foo2(.:format) Redirect (307)", output[1] + + assert_equal " foo GET /foo(.:format) redirect(301, /foo/bar) {:subdomain=>\"admin\"}", output[0] + assert_equal " bar GET /bar(.:format) redirect(307, path: /foo/bar)", output[1] + assert_equal "foobar GET /foobar(.:format) redirect(301)", output[2] end end end |