From 0a5b08a1e7a50377f94b50e2fdadf9551ad81912 Mon Sep 17 00:00:00 2001 From: Ronak Jangir Date: Sat, 22 Aug 2015 09:33:53 +0530 Subject: Removed Mocha from ActionView part 1 --- actionview/test/template/translation_helper_test.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'actionview/test/template/translation_helper_test.rb') diff --git a/actionview/test/template/translation_helper_test.rb b/actionview/test/template/translation_helper_test.rb index 5dc281adb2..749d0dd7fd 100644 --- a/actionview/test/template/translation_helper_test.rb +++ b/actionview/test/template/translation_helper_test.rb @@ -42,14 +42,16 @@ class TranslationHelperTest < ActiveSupport::TestCase end def test_delegates_setting_to_i18n - I18n.expects(:translate).with(:foo, :locale => 'en', :raise => true).returns("") - translate :foo, :locale => 'en' + assert_called_with(I18n, :translate, [:foo, :locale => 'en', :raise => true], returns: "") do + translate :foo, :locale => 'en' + end end def test_delegates_localize_to_i18n @time = Time.utc(2008, 7, 8, 12, 18, 38) - I18n.expects(:localize).with(@time) - localize @time + assert_called_with(I18n, :localize, [@time]) do + localize @time + end end def test_returns_missing_translation_message_wrapped_into_span @@ -125,8 +127,9 @@ class TranslationHelperTest < ActiveSupport::TestCase end def test_translate_escapes_interpolations_in_translations_with_a_html_suffix + word_struct = Struct.new(:to_s) assert_equal 'Hello <World>', translate(:'translations.interpolated_html', :word => '') - assert_equal 'Hello <World>', translate(:'translations.interpolated_html', :word => stub(:to_s => "")) + assert_equal 'Hello <World>', translate(:'translations.interpolated_html', :word => word_struct.new("")) end def test_translate_with_html_count -- cgit v1.2.3