From 35ec1c928f100f5b75bd2e6af63d26b10ba2282c Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Sun, 28 Jan 2007 05:29:32 +0000 Subject: Fix doubly appearing parameters due to string and symbol mixups. Closes #2551. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6053 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/url_rewriter_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/url_rewriter_test.rb b/actionpack/test/controller/url_rewriter_test.rb index 882add496f..d3bee976a2 100644 --- a/actionpack/test/controller/url_rewriter_test.rb +++ b/actionpack/test/controller/url_rewriter_test.rb @@ -17,6 +17,15 @@ class UrlRewriterTests < Test::Unit::TestCase assert_match %r(/hi/hi/2$), u end + def test_overwrite_removes_original + @params[:controller] = 'search' + @params[:action] = 'list' + @params[:list_page] = 1 + + assert_equal '/search/list?list_page=2', @rewriter.rewrite(:only_path => true, :overwrite_params => {"list_page" => 2}) + u = @rewriter.rewrite(:only_path => false, :overwrite_params => {:list_page => 2}) + assert_equal 'http://test.host/search/list?list_page=2', u + end private def split_query_string(str) -- cgit v1.2.3