From 9cba9de74a59df1b9572a5d25911a5cff9ca2322 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Thu, 5 May 2016 16:51:16 -0300 Subject: [PATCH] html_safe: fix edition of highlights block --- app/helpers/block_helper.rb | 2 +- test/integration/safe_strings_test.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/helpers/block_helper.rb b/app/helpers/block_helper.rb index 089175d..8dce8b6 100644 --- a/app/helpers/block_helper.rb +++ b/app/helpers/block_helper.rb @@ -28,7 +28,7 @@ module BlockHelper } #{button_without_text(:delete, _('Remove'), '#', class: 'delete-highlight', data: {confirm: _('Are you sure you want to remove this highlight')})} - " + ".html_safe end end diff --git a/test/integration/safe_strings_test.rb b/test/integration/safe_strings_test.rb index 84d42cf..6d24403 100644 --- a/test/integration/safe_strings_test.rb +++ b/test/integration/safe_strings_test.rb @@ -155,4 +155,12 @@ class SafeStringsTest < ActionDispatch::IntegrationTest get url_for(action: :edit, controller: :profile_design, profile: person.identifier, id: block.id) assert_select '.block-config-options .other-block' end + + should 'not escape edit settings in highlight block' do + login user.login, 'test' + block = HighlightsBlock.new + person.boxes.first.blocks << block + get url_for(action: :edit, controller: :profile_design, profile: person.identifier, id: block.id) + assert_select '.block-config-options .image-data-line' + end end -- libgit2 0.21.2