From 283a22bd31c26f6d6a1ffb893c4a16f93c85e7db Mon Sep 17 00:00:00 2001 From: chaymae BZ Date: Tue, 8 Oct 2024 16:26:00 +0100 Subject: [PATCH] Fix escape_html tests (#2296) --- padrino-helpers/test/test_format_helpers.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/padrino-helpers/test/test_format_helpers.rb b/padrino-helpers/test/test_format_helpers.rb index e716c3462..397514167 100644 --- a/padrino-helpers/test/test_format_helpers.rb +++ b/padrino-helpers/test/test_format_helpers.rb @@ -31,7 +31,7 @@ def setup it 'should escape html tags' do actual_text = simple_format("Will you escape that?") - assert_equal "

Will you escape <b>that</b>?

", actual_text + assert_equal "

Will you escape <b>that</b>?

", actual_text end it 'should support already sanitized text' do @@ -118,18 +118,18 @@ def setup describe 'for #h and #h! method' do it 'should escape the simple html' do - assert_equal '<h1>hello</h1>', h('

hello

') - assert_equal '<h1>hello</h1>', escape_html('

hello

') + assert_equal '<h1>hello</h1>', h('

hello

') + assert_equal '<h1>hello</h1>', escape_html('

hello

') end it 'should escape all brackets, quotes and ampersands' do - assert_equal '<h1><>"&demo&"<></h1>', h('

<>"&demo&"<>

') + assert_equal '<h1><>"&demo&"<></h1>', h('

<>"&demo&"<>

') end it 'should return default text if text is empty' do assert_equal 'default', h!("", "default") assert_equal ' ', h!("") end it 'should return text escaped if not empty' do - assert_equal '<h1>hello</h1>', h!('

hello

') + assert_equal '<h1>hello</h1>', h!('

hello

') end it 'should mark escaped text as safe' do assert_equal false, '

hello

'.html_safe?