aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/url_rewriter_test.rb
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2007-05-02 04:40:33 +0000
committerNicholas Seckar <nseckar@gmail.com>2007-05-02 04:40:33 +0000
commit5a3bb880db43f7bfba3a2838841baaff3d9050af (patch)
treeeef8bb68bb1242783ff7c979c02686fc341af101 /actionpack/test/controller/url_rewriter_test.rb
parent8f5c83bdeac2d345f3ec55ecb6460a76c4450a48 (diff)
downloadrails-5a3bb880db43f7bfba3a2838841baaff3d9050af.tar.gz
rails-5a3bb880db43f7bfba3a2838841baaff3d9050af.tar.bz2
rails-5a3bb880db43f7bfba3a2838841baaff3d9050af.zip
Update UrlWriter to accept :anchor parameter. Closes #6771.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6648 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/url_rewriter_test.rb')
-rw-r--r--actionpack/test/controller/url_rewriter_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_rewriter_test.rb b/actionpack/test/controller/url_rewriter_test.rb
index eee98c49f3..9ca482f79c 100644
--- a/actionpack/test/controller/url_rewriter_test.rb
+++ b/actionpack/test/controller/url_rewriter_test.rb
@@ -36,6 +36,13 @@ class UrlRewriterTests < Test::Unit::TestCase
@rewriter.rewrite(:user => "openid.aol.com/nextangler", :password => "one two?", :controller => 'c', :action => 'a', :id => 'i')
)
end
+
+ def test_anchor
+ assert_equal(
+ 'http://test.host/c/a/i#anchor',
+ @rewriter.rewrite(:controller => 'c', :action => 'a', :id => 'i', :anchor => 'anchor')
+ )
+ end
def test_overwrite_params
@params[:controller] = 'hi'
@@ -77,6 +84,12 @@ class UrlWriterTests < Test::Unit::TestCase
W.new.url_for :controller => 'c', :action => 'a', :id => 'i'
end
end
+
+ def test_anchor
+ assert_equal('/c/a#anchor',
+ W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :anchor => 'anchor')
+ )
+ end
def test_default_host
add_host!