Permalink
Browse files

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
  • Loading branch information...
1 parent c7f50e9 commit 35ec1c928f100f5b75bd2e6af63d26b10ba2282c @seckar seckar committed Jan 28, 2007
View
@@ -1,5 +1,7 @@
*SVN*
+* Fix doubly appearing parameters due to string and symbol mixups. Closes #2551. [aeden]
+
* Fix overly greedy rescues when loading helpers. Fixes #6268. [Nicholas Seckar]
* Fixed NumberHelper#number_with_delimiter to use "." always for splitting the original number, not the delimiter parameter #7389 [ceefour]
@@ -96,7 +96,7 @@ def rewrite_path(options)
options.update(options[:params].symbolize_keys) if options[:params]
if (overwrite = options.delete(:overwrite_params))
options.update(@parameters.symbolize_keys)
- options.update(overwrite)
+ options.update(overwrite.symbolize_keys)
end
RESERVED_OPTIONS.each {|k| options.delete k}
@@ -17,6 +17,15 @@ def test_overwrite_params
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)

0 comments on commit 35ec1c9

Please sign in to comment.