diff options
author | Erik Andrejko <eandrejko@gmail.com> | 2008-10-26 11:46:17 -0500 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-10-26 19:14:45 +0100 |
commit | ef9b6b5cba08f13dcbf7095226b78aaf22df13f7 (patch) | |
tree | d9b332eba71925ceb524fbf638369bafe19d8786 /actionpack/test/template | |
parent | 2c7abe1b5682d287b19dde5900087908c976109c (diff) | |
download | rails-ef9b6b5cba08f13dcbf7095226b78aaf22df13f7.tar.gz rails-ef9b6b5cba08f13dcbf7095226b78aaf22df13f7.tar.bz2 rails-ef9b6b5cba08f13dcbf7095226b78aaf22df13f7.zip |
modified current_page? to ignore extra parameters unless specified in options
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#805 state:committed]
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 85e967ac1c..797b74efe6 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -258,6 +258,16 @@ class UrlHelperTest < ActionView::TestCase assert_equal "Showing", link_to_unless_current("Showing", { :action => "show", :controller => "weblog" }) assert_equal "Showing", link_to_unless_current("Showing", "http://www.example.com/weblog/show") + @controller.request = RequestMock.new("http://www.example.com/weblog/show?order=desc") + @controller.url = "http://www.example.com/weblog/show" + assert_equal "Showing", link_to_unless_current("Showing", { :action => "show", :controller => "weblog" }) + assert_equal "Showing", link_to_unless_current("Showing", "http://www.example.com/weblog/show") + + @controller.request = RequestMock.new("http://www.example.com/weblog/show?order=desc") + @controller.url = "http://www.example.com/weblog/show?order=asc" + assert_equal "<a href=\"http://www.example.com/weblog/show?order=asc\">Showing</a>", link_to_unless_current("Showing", { :action => "show", :controller => "weblog" }) + assert_equal "<a href=\"http://www.example.com/weblog/show?order=asc\">Showing</a>", link_to_unless_current("Showing", "http://www.example.com/weblog/show?order=asc") + @controller.request = RequestMock.new("http://www.example.com/weblog/show") @controller.url = "http://www.example.com/weblog/list" assert_equal "<a href=\"http://www.example.com/weblog/list\">Listing</a>", |