diff options
author | wycats <wycats@gmail.com> | 2010-05-17 19:51:30 +0400 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-05-17 19:51:30 +0400 |
commit | f09d8f3e68ca7cf35a7905b00f85b84c3839c803 (patch) | |
tree | ae3e6b5da9fcdfd709214f5986fb6e28fe09aa20 /actionpack/test | |
parent | c3b7471c69b42132a5189013f1a8d7c7225a9127 (diff) | |
parent | c7e6777961239224e28171a46c9768db881c5506 (diff) | |
download | rails-f09d8f3e68ca7cf35a7905b00f85b84c3839c803.tar.gz rails-f09d8f3e68ca7cf35a7905b00f85b84c3839c803.tar.bz2 rails-f09d8f3e68ca7cf35a7905b00f85b84c3839c803.zip |
Merge remote branch 'origin/master'
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 12 | ||||
-rw-r--r-- | actionpack/test/template/number_helper_i18n_test.rb | 17 |
2 files changed, 28 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 651a7a6be0..180889ddf2 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -186,6 +186,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end resources :products, :constraints => { :id => /\d{4}/ } do + root :to => "products#root" + get :favorite, :on => :collection resources :images end @@ -963,7 +965,9 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest get '/products/1' assert_equal 'pass', @response.headers['X-Cascade'] get '/products' - assert_equal 'products#index', @response.body + assert_equal 'products#root', @response.body + get '/products/favorite' + assert_equal 'products#favorite', @response.body get '/products/0001' assert_equal 'products#show', @response.body @@ -981,6 +985,12 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_root_works_in_the_resources_scope + get '/products' + assert_equal 'products#root', @response.body + assert_equal '/products', products_root_path + end + def test_module_scope with_test_routes do get '/token' diff --git a/actionpack/test/template/number_helper_i18n_test.rb b/actionpack/test/template/number_helper_i18n_test.rb index f730a0d7f5..8561019461 100644 --- a/actionpack/test/template/number_helper_i18n_test.rb +++ b/actionpack/test/template/number_helper_i18n_test.rb @@ -45,6 +45,12 @@ class NumberHelperTest < ActionView::TestCase assert_equal("&$ - 10.00", number_to_currency(10, :locale => 'ts')) end + def test_number_to_currency_with_clean_i18n_settings + clean_i18n do + assert_equal("$10.00", number_to_currency(10)) + end + end + def test_number_with_precision #Delimiter was set to "" assert_equal("10000", number_with_precision(10000, :locale => 'ts')) @@ -92,4 +98,15 @@ class NumberHelperTest < ActionView::TestCase #Significant was set to true with precision 2, with custom translated units assert_equal "4.3 cm", number_to_human(0.0432, :locale => 'ts', :units => :custom_units_for_number_to_human) end + + private + def clean_i18n + load_path = I18n.load_path.dup + I18n.load_path.clear + I18n.reload! + yield + ensure + I18n.load_path = load_path + I18n.reload! + end end |