aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/base_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2010-03-08 21:40:04 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2010-03-08 21:40:45 -0800
commitc507e16dba844c7b066d145bfd5c5d23e7a9c5ad (patch)
tree7a0792357c11994ba1dddf4d4cd187198786bd39 /actionpack/test/controller/base_test.rb
parent514d3a47f4a6a7a46054b45cb6b78ba37d62618e (diff)
downloadrails-c507e16dba844c7b066d145bfd5c5d23e7a9c5ad.tar.gz
rails-c507e16dba844c7b066d145bfd5c5d23e7a9c5ad.tar.bz2
rails-c507e16dba844c7b066d145bfd5c5d23e7a9c5ad.zip
Reinstate default_url_options and remove url_options= writer
Diffstat (limited to 'actionpack/test/controller/base_test.rb')
-rw-r--r--actionpack/test/controller/base_test.rb42
1 files changed, 19 insertions, 23 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb
index ade9a7fcba..3e9f8ae048 100644
--- a/actionpack/test/controller/base_test.rb
+++ b/actionpack/test/controller/base_test.rb
@@ -181,7 +181,7 @@ class UrlOptionsTest < ActionController::TestCase
rescue_action_in_public!
end
- def test_default_url_options_are_used_if_set
+ def test_url_options_override
with_routing do |set|
set.draw do |map|
match 'from_view', :to => 'url_options#from_view', :as => :from_view
@@ -206,20 +206,18 @@ class DefaultUrlOptionsTest < ActionController::TestCase
rescue_action_in_public!
end
- def test_default_url_options_are_used_if_set
+ def test_default_url_options_override
with_routing do |set|
set.draw do |map|
match 'from_view', :to => 'default_url_options#from_view', :as => :from_view
match ':controller/:action'
end
- assert_deprecated do
- get :from_view, :route => "from_view_url"
+ get :from_view, :route => "from_view_url"
- assert_equal 'http://www.override.com/from_view?locale=en', @response.body
- assert_equal 'http://www.override.com/from_view?locale=en', @controller.send(:from_view_url)
- assert_equal 'http://www.override.com/default_url_options/new?locale=en', @controller.url_for(:controller => 'default_url_options')
- end
+ assert_equal 'http://www.override.com/from_view?locale=en', @response.body
+ assert_equal 'http://www.override.com/from_view?locale=en', @controller.send(:from_view_url)
+ assert_equal 'http://www.override.com/default_url_options/new?locale=en', @controller.url_for(:controller => 'default_url_options')
end
end
@@ -232,21 +230,19 @@ class DefaultUrlOptionsTest < ActionController::TestCase
match ':controller/:action'
end
- assert_deprecated do
- get :from_view, :route => "description_path(1)"
-
- assert_equal '/en/descriptions/1', @response.body
- assert_equal '/en/descriptions', @controller.send(:descriptions_path)
- assert_equal '/pl/descriptions', @controller.send(:descriptions_path, "pl")
- assert_equal '/pl/descriptions', @controller.send(:descriptions_path, :locale => "pl")
- assert_equal '/pl/descriptions.xml', @controller.send(:descriptions_path, "pl", "xml")
- assert_equal '/en/descriptions.xml', @controller.send(:descriptions_path, :format => "xml")
- assert_equal '/en/descriptions/1', @controller.send(:description_path, 1)
- assert_equal '/pl/descriptions/1', @controller.send(:description_path, "pl", 1)
- assert_equal '/pl/descriptions/1', @controller.send(:description_path, 1, :locale => "pl")
- assert_equal '/pl/descriptions/1.xml', @controller.send(:description_path, "pl", 1, "xml")
- assert_equal '/en/descriptions/1.xml', @controller.send(:description_path, 1, :format => "xml")
- end
+ get :from_view, :route => "description_path(1)"
+
+ assert_equal '/en/descriptions/1', @response.body
+ assert_equal '/en/descriptions', @controller.send(:descriptions_path)
+ assert_equal '/pl/descriptions', @controller.send(:descriptions_path, "pl")
+ assert_equal '/pl/descriptions', @controller.send(:descriptions_path, :locale => "pl")
+ assert_equal '/pl/descriptions.xml', @controller.send(:descriptions_path, "pl", "xml")
+ assert_equal '/en/descriptions.xml', @controller.send(:descriptions_path, :format => "xml")
+ assert_equal '/en/descriptions/1', @controller.send(:description_path, 1)
+ assert_equal '/pl/descriptions/1', @controller.send(:description_path, "pl", 1)
+ assert_equal '/pl/descriptions/1', @controller.send(:description_path, 1, :locale => "pl")
+ assert_equal '/pl/descriptions/1.xml', @controller.send(:description_path, "pl", 1, "xml")
+ assert_equal '/en/descriptions/1.xml', @controller.send(:description_path, 1, :format => "xml")
end
end