aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/translation_helper_test.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2015-08-24 10:29:27 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2015-08-24 10:29:27 +0200
commitef8d09d932e36b0614905ea5bc3fb6af318b6ce2 (patch)
treec00eb8242e07fa0f3f875284ccb91f29c3ddca4f /actionview/test/template/translation_helper_test.rb
parent4f252cddc1ee4e28c633a2250335b2fac4d31108 (diff)
parent0a5b08a1e7a50377f94b50e2fdadf9551ad81912 (diff)
downloadrails-ef8d09d932e36b0614905ea5bc3fb6af318b6ce2.tar.gz
rails-ef8d09d932e36b0614905ea5bc3fb6af318b6ce2.tar.bz2
rails-ef8d09d932e36b0614905ea5bc3fb6af318b6ce2.zip
Merge pull request #21347 from ronakjangir47/remove_mocha_actionview
Removed Mocha from ActionView part 1
Diffstat (limited to 'actionview/test/template/translation_helper_test.rb')
-rw-r--r--actionview/test/template/translation_helper_test.rb13
1 files changed, 8 insertions, 5 deletions
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 '<a>Hello &lt;World&gt;</a>', translate(:'translations.interpolated_html', :word => '<World>')
- assert_equal '<a>Hello &lt;World&gt;</a>', translate(:'translations.interpolated_html', :word => stub(:to_s => "<World>"))
+ assert_equal '<a>Hello &lt;World&gt;</a>', translate(:'translations.interpolated_html', :word => word_struct.new("<World>"))
end
def test_translate_with_html_count