1 require 'abstract_unit'
3 class TranslationHelperTest
< Test
::Unit::TestCase
4 include ActionView
::Helpers::TagHelper
5 include ActionView
::Helpers::TranslationHelper
8 uses_mocha
'translation_helper_test' do
12 def test_delegates_to_i18n_setting_the_raise_option
13 I18n
.expects(:translate).with(:foo, :locale => 'en', :raise => true)
14 translate
:foo, :locale => 'en'
17 def test_returns_missing_translation_message_wrapped_into_span
18 expected
= '<span class="translation_missing">en, foo</span>'
19 assert_equal expected
, translate(:foo)
22 def test_delegates_localize_to_i18n
23 @time = Time
.utc(2008, 7, 8, 12, 18, 38)
24 I18n
.expects(:localize).with(@time)