diff options
author | Cheah Chu Yeow <chuyeow@gmail.com> | 2008-06-23 20:51:38 +0800 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-07-09 13:02:14 +0100 |
commit | 96708af6a58a48c2324a3bf8d34232bc29b398c9 (patch) | |
tree | 48a7259154f5349d57ee73b06fadcd1dd25aaf91 /actionpack/test | |
parent | 2b4eb586efa240dd985d8b5fe918084ab17fae2b (diff) | |
download | rails-96708af6a58a48c2324a3bf8d34232bc29b398c9.tar.gz rails-96708af6a58a48c2324a3bf8d34232bc29b398c9.tar.bz2 rails-96708af6a58a48c2324a3bf8d34232bc29b398c9.zip |
Ensure url_for(nil) falls back to url_for({}). [#472 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 3d5f7eae11..8e43629522 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -313,6 +313,10 @@ class UrlHelperWithControllerTest < ActionView::TestCase render :inline => "<%= show_named_route_#{params[:kind]} %>" end + def nil_url_for + render :inline => '<%= url_for(nil) %>' + end + def rescue_action(e) raise e end end @@ -329,7 +333,7 @@ class UrlHelperWithControllerTest < ActionView::TestCase assert_equal '/url_helper_with_controller/show_url_for', @response.body end - def test_named_route_shows_host_and_path + def test_named_route_url_shows_host_and_path with_url_helper_routing do get :show_named_route, :kind => 'url' assert_equal 'http://test.host/url_helper_with_controller/show_named_route', @response.body @@ -343,6 +347,11 @@ class UrlHelperWithControllerTest < ActionView::TestCase end end + def test_url_for_nil_returns_current_path + get :nil_url_for + assert_equal '/url_helper_with_controller/nil_url_for', @response.body + end + protected def with_url_helper_routing with_routing do |set| |