diff options
author | Vasiliy Ermolovich <younash@gmail.com> | 2012-01-29 01:17:57 +0300 |
---|---|---|
committer | Vasiliy Ermolovich <younash@gmail.com> | 2012-01-29 18:26:38 +0300 |
commit | 735c56d0cd7449183c1de717091b29e57b663f47 (patch) | |
tree | 50881b35a4d34a3d5c884a8df54dfa959ef7fcbf /actionpack/test | |
parent | fd3211ef677efe9531f38db58919a8c90d65892a (diff) | |
download | rails-735c56d0cd7449183c1de717091b29e57b663f47.tar.gz rails-735c56d0cd7449183c1de717091b29e57b663f47.tar.bz2 rails-735c56d0cd7449183c1de717091b29e57b663f47.zip |
tiny refactoring
use :default option with translate method instead of condition
simplify separator method
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/date_helper_i18n_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/test/template/date_helper_i18n_test.rb b/actionpack/test/template/date_helper_i18n_test.rb index ef3d7d97ee..82b62e64f3 100644 --- a/actionpack/test/template/date_helper_i18n_test.rb +++ b/actionpack/test/template/date_helper_i18n_test.rb @@ -103,7 +103,7 @@ class DateHelperSelectTagsI18nTests < ActiveSupport::TestCase I18n.expects(:translate).with(('datetime.prompts.' + key.to_s).to_sym, :locale => 'en').returns prompt end - I18n.expects(:translate).with(:'date.order', :locale => 'en').returns [:year, :month, :day] + I18n.expects(:translate).with(:'date.order', :locale => 'en', :default => []).returns [:year, :month, :day] datetime_select('post', 'updated_at', :locale => 'en', :include_seconds => true, :prompt => true) end @@ -115,12 +115,12 @@ class DateHelperSelectTagsI18nTests < ActiveSupport::TestCase end def test_date_or_time_select_given_no_order_options_translates_order - I18n.expects(:translate).with(:'date.order', :locale => 'en').returns [:year, :month, :day] + I18n.expects(:translate).with(:'date.order', :locale => 'en', :default => []).returns [:year, :month, :day] datetime_select('post', 'updated_at', :locale => 'en') end def test_date_or_time_select_given_invalid_order - I18n.expects(:translate).with(:'date.order', :locale => 'en').returns [:invalid, :month, :day] + I18n.expects(:translate).with(:'date.order', :locale => 'en', :default => []).returns [:invalid, :month, :day] assert_raise StandardError do datetime_select('post', 'updated_at', :locale => 'en') |