aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/translation_helper_test.rb
diff options
context:
space:
mode:
authorRonak Jangir <ronakjangir47@gmail.com>2015-08-22 09:33:53 +0530
committerRonak Jangir <ronakjangir47@gmail.com>2015-08-24 08:59:19 +0530
commit0a5b08a1e7a50377f94b50e2fdadf9551ad81912 (patch)
tree24adadca3faaef8787cb9fa42cc4efd0a280634a /actionview/test/template/translation_helper_test.rb
parent9503e65b9718e4f01860cf017c1cdcdccdfffde7 (diff)
downloadrails-0a5b08a1e7a50377f94b50e2fdadf9551ad81912.tar.gz
rails-0a5b08a1e7a50377f94b50e2fdadf9551ad81912.tar.bz2
rails-0a5b08a1e7a50377f94b50e2fdadf9551ad81912.zip
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