aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2005-09-06 22:06:11 +0000
committerNicholas Seckar <nseckar@gmail.com>2005-09-06 22:06:11 +0000
commit3108764367023aabaee04d1dbcbed8eb76e61184 (patch)
tree544696039d567618de9b58d266e5225c20004dff /actionpack/test
parentf2a89d7862313505562186620a07d498190971c3 (diff)
downloadrails-3108764367023aabaee04d1dbcbed8eb76e61184.tar.gz
rails-3108764367023aabaee04d1dbcbed8eb76e61184.tar.bz2
rails-3108764367023aabaee04d1dbcbed8eb76e61184.zip
Fix overwrite params. Closes #1909
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2144 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/url_rewriter_tests.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_rewriter_tests.rb b/actionpack/test/controller/url_rewriter_tests.rb
index 392024f03d..af26c2dcf5 100644
--- a/actionpack/test/controller/url_rewriter_tests.rb
+++ b/actionpack/test/controller/url_rewriter_tests.rb
@@ -23,5 +23,15 @@ class UrlRewriterTests < Test::Unit::TestCase
def test_escape_spaces_build_query_string_selected_keys
assert_equal '?x=hello+world', @rewriter.send(:build_query_string, {:x => 'hello world', :y => 'goodbye world'}, [:x])
end
+
+ def test_overwrite_params
+ @params[:controller] = 'hi'
+ @params[:action] = 'bye'
+ @params[:id] = '2'
+
+ assert_equal '/hi/hi/2', @rewriter.rewrite(:only_path => true, :overwrite_params => {:action => 'hi'})
+ u = @rewriter.rewrite(:only_path => false, :overwrite_params => {:action => 'hi'})
+ assert_match %r(/hi/hi/2$), u
+ end
end