diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-07 19:12:02 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-07 19:12:02 +0000 |
commit | d9f3c435f907b8097669a7f2c923f731837fb045 (patch) | |
tree | 68826445dfcadb167950e318f19c807711971d9c /actionpack/test | |
parent | c90d31eb376ebe331394112697ec33a22f61c2d8 (diff) | |
download | rails-d9f3c435f907b8097669a7f2c923f731837fb045.tar.gz rails-d9f3c435f907b8097669a7f2c923f731837fb045.tar.bz2 rails-d9f3c435f907b8097669a7f2c923f731837fb045.zip |
Fix url_for, redirect_to, etc. with :controller => :symbol instead of 'string'. Closes #8562, #9525.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7776 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/action_pack_assertions_test.rb | 13 | ||||
-rw-r--r-- | actionpack/test/controller/url_rewriter_test.rb | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index 75d0e17f61..1eb9610d04 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -19,6 +19,8 @@ class ActionPackAssertionsController < ActionController::Base def redirect_to_controller() redirect_to :controller => "elsewhere", :action => "flash_me"; end + def redirect_to_controller_with_symbol() redirect_to :controller => :elsewhere, :action => :flash_me; end + def redirect_to_path() redirect_to '/some/path' end def redirect_to_named_route() redirect_to route_one_url end @@ -429,6 +431,17 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase assert_redirected_to 'http://test.host/some/path' end + def test_assert_redirection_with_symbol + process :redirect_to_controller_with_symbol + assert_nothing_raised { + assert_redirected_to :controller => "elsewhere", :action => "flash_me" + } + process :redirect_to_controller_with_symbol + assert_nothing_raised { + assert_redirected_to :controller => :elsewhere, :action => :flash_me + } + end + def test_redirected_to_with_nested_controller @controller = Admin::InnerModuleController.new get :redirect_to_absolute_controller diff --git a/actionpack/test/controller/url_rewriter_test.rb b/actionpack/test/controller/url_rewriter_test.rb index 3c1d584d89..75497c832c 100644 --- a/actionpack/test/controller/url_rewriter_test.rb +++ b/actionpack/test/controller/url_rewriter_test.rb @@ -234,6 +234,10 @@ class UrlWriterTests < Test::Unit::TestCase assert_equal params[3], { 'query[person][position][]' => 'art director' }.to_query end + def test_path_generation_for_symbol_parameter_keys + assert_generates("/image", :controller=> :image) + end + private def extract_params(url) url.split('?', 2).last.split('&') |