diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/url_rewriter_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_rewriter_test.rb b/actionpack/test/controller/url_rewriter_test.rb index 1c746b7aee..a49aaa822a 100644 --- a/actionpack/test/controller/url_rewriter_test.rb +++ b/actionpack/test/controller/url_rewriter_test.rb @@ -73,6 +73,16 @@ class UrlRewriterTests < Test::Unit::TestCase assert_equal 'http://, test.host, /, hi, bye, {"id"=>"2"}', @rewriter.to_str end + + def test_trailing_slash + options = {:controller => 'foo', :action => 'bar', :id => '3', :only_path => true} + assert_equal '/foo/bar/3', @rewriter.rewrite(options) + assert_equal '/foo/bar/3?query=string', @rewriter.rewrite(options.merge({:query => 'string'})) + options.update({:trailing_slash => true}) + assert_equal '/foo/bar/3/', @rewriter.rewrite(options) + options.update({:query => 'string'}) + assert_equal '/foo/bar/3/?query=string', @rewriter.rewrite(options) + end end class UrlWriterTests < Test::Unit::TestCase |