diff options
author | Rizwan Reza <rizwanreza@gmail.com> | 2010-06-14 13:13:13 +0430 |
---|---|---|
committer | Rizwan Reza <rizwanreza@gmail.com> | 2010-06-14 13:13:13 +0430 |
commit | bf7429041e64ee0f347764a4579c8c1d14d5b391 (patch) | |
tree | e52044f40d8ea2310aef97790b5374ac8b8558a4 /actionpack/test | |
parent | 4b05de19aaebcbe20941e8b13aaed2060759ed1c (diff) | |
parent | c125116013d4b4222f507cfbd1da5ae90bd225d9 (diff) | |
download | rails-bf7429041e64ee0f347764a4579c8c1d14d5b391.tar.gz rails-bf7429041e64ee0f347764a4579c8c1d14d5b391.tar.bz2 rails-bf7429041e64ee0f347764a4579c8c1d14d5b391.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/fixtures/layouts/yield_with_render_inline_inside.erb | 2 | ||||
-rw-r--r-- | actionpack/test/template/render_test.rb | 6 | ||||
-rw-r--r-- | actionpack/test/template/text_helper_test.rb | 18 |
3 files changed, 17 insertions, 9 deletions
diff --git a/actionpack/test/fixtures/layouts/yield_with_render_inline_inside.erb b/actionpack/test/fixtures/layouts/yield_with_render_inline_inside.erb new file mode 100644 index 0000000000..7298d79690 --- /dev/null +++ b/actionpack/test/fixtures/layouts/yield_with_render_inline_inside.erb @@ -0,0 +1,2 @@ +<%= render :inline => 'welcome' %> +<%= yield %> diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index aca96e0a24..059dcedad8 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -229,6 +229,12 @@ module RenderTestCases @view.render(:file => "test/hello_world.erb", :layout => "layouts/yield") end + def test_render_with_layout_which_has_render_inline + assert_equal %(welcome\nHello world!\n), + @view.render(:file => "test/hello_world.erb", :layout => "layouts/yield_with_render_inline_inside") + end + + # TODO: Move to deprecated_tests.rb def test_render_with_nested_layout_deprecated assert_deprecated do diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 108cf510ff..b0a4c2a9cc 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -40,15 +40,15 @@ class TextHelperTest < ActionView::TestCase assert simple_format("<b> test with html tags </b>").html_safe? end - def test_simple_format_should_sanitize_unsafe_input + def test_simple_format_should_escape_unsafe_input assert_equal "<p><b> test with unsafe string </b><script>code!</script></p>", simple_format("<b> test with unsafe string </b><script>code!</script>") end - def test_simple_format_should_not_sanitize_input_if_safe_option + def test_simple_format_should_not_escape_input_if_safe_option assert_equal "<p><b> test with unsafe string </b><script>code!</script></p>", simple_format("<b> test with unsafe string </b><script>code!</script>", {}, :safe => true) end - def test_simple_format_should_not_sanitize_safe_input + def test_simple_format_should_not_escape_safe_input assert_equal "<p><b> test with safe string </b></p>", simple_format("<b> test with safe string </b>".html_safe) end @@ -61,16 +61,16 @@ class TextHelperTest < ActionView::TestCase assert_equal "Hello Wor...", truncate("Hello World!!", :length => 12) end - def test_truncate_should_sanitize_unsafe_input + def test_truncate_should_escape_unsafe_input assert_equal "Hello <...", truncate("Hello <script>code!</script>World!!", :length => 12) end - def test_truncate_should_not_sanitize_input_if_safe_option + def test_truncate_should_not_escape_input_if_safe_option assert_equal "Hello <sc...", truncate("Hello <script>code!</script>World!", :length => 12, :safe => true) assert_equal "Hello <sc...", truncate("Hello <script>code!</script>World!!", :length => 12, :safe => true) end - def test_truncate_should_not_sanitize_safe_input + def test_truncate_should_not_escape_safe_input assert_equal "Hello <sc...", truncate("Hello <script>code!</script>World!".html_safe, :length => 12) assert_equal "Hello <sc...", truncate("Hello <script>code!</script>World!!".html_safe, :length => 12) end @@ -138,21 +138,21 @@ class TextHelperTest < ActionView::TestCase assert_equal ' ', highlight(' ', 'blank text is returned verbatim') end - def test_highlight_should_sanitize_unsafe_input + def test_highlight_should_escape_unsafe_input assert_equal( "This is a <strong class=\"highlight\">beautiful</strong> morning<script>code!</script>", highlight("This is a beautiful morning<script>code!</script>", "beautiful") ) end - def test_highlight_should_not_sanitize_input_if_safe_option + def test_highlight_should_not_escape_input_if_safe_option assert_equal( "This is a <strong class=\"highlight\">beautiful</strong> morning<script>code!</script>", highlight("This is a beautiful morning<script>code!</script>", "beautiful", :safe => true) ) end - def test_highlight_should_not_sanitize_safe_input + def test_highlight_should_not_escape_safe_input assert_equal( "This is a <strong class=\"highlight\">beautiful</strong> morning<script>code!</script>", highlight("This is a beautiful morning<script>code!</script>".html_safe, "beautiful") |