diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-07-14 09:28:56 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-07-14 09:28:56 +0000 |
commit | 5476a6a6c7e3be5722481a2bd3b60322f1672c1e (patch) | |
tree | f34a4599aac4de840fc80eb65294bebee196e50f /actionpack/test/controller | |
parent | f9b7394430f50c110b0f07d7e3c06d5b3d9b0f44 (diff) | |
download | rails-5476a6a6c7e3be5722481a2bd3b60322f1672c1e.tar.gz rails-5476a6a6c7e3be5722481a2bd3b60322f1672c1e.tar.bz2 rails-5476a6a6c7e3be5722481a2bd3b60322f1672c1e.zip |
Make :trailing_slash work with query parameters for url_for. Closes #4004 [nov]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7186 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-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 |