From a156562762e795c2e5382570c1fc30c11cfa9a24 Mon Sep 17 00:00:00 2001 From: Mario Visic Date: Wed, 4 Dec 2013 13:50:17 +1100 Subject: Fix issue where TextHelper#simple_format was calling missing 'raw' method --- actionview/test/template/text_helper_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionview/test/template/text_helper_test.rb') diff --git a/actionview/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb index dd1a92acfb..5b3bccf951 100644 --- a/actionview/test/template/text_helper_test.rb +++ b/actionview/test/template/text_helper_test.rb @@ -21,6 +21,11 @@ class TextHelperTest < ActionView::TestCase assert simple_format(" test with html tags ").html_safe? end + def test_simple_format_included_in_isolation + helper_klass = Class.new { include ActionView::Helpers::TextHelper } + assert helper_klass.new.simple_format(" test with html tags ").html_safe? + end + def test_simple_format assert_equal "

", simple_format(nil) -- cgit v1.2.3 From 1eaa521273399d789565af1933a0e6e4462511a4 Mon Sep 17 00:00:00 2001 From: Kristian Freeman Date: Tue, 26 Nov 2013 12:09:52 -0800 Subject: A Cycle object should accept an array and cycle through it as it would with a set of comma-separated objects. --- actionview/test/template/text_helper_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionview/test/template/text_helper_test.rb') diff --git a/actionview/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb index dd1a92acfb..c280a22843 100644 --- a/actionview/test/template/text_helper_test.rb +++ b/actionview/test/template/text_helper_test.rb @@ -381,6 +381,13 @@ class TextHelperTest < ActionView::TestCase assert_equal("3", cycle("one", 2, "3")) end + def test_cycle_with_array + array = [1, 2, 3] + assert_equal("1", cycle(array)) + assert_equal("2", cycle(array)) + assert_equal("3", cycle(array)) + end + def test_cycle_with_no_arguments assert_raise(ArgumentError) { cycle } end -- cgit v1.2.3