Commit 9cba9de74a59df1b9572a5d25911a5cff9ca2322

Authored by Victor Costa
1 parent 839e0c57

html_safe: fix edition of highlights block

app/helpers/block_helper.rb
@@ -28,7 +28,7 @@ module BlockHelper @@ -28,7 +28,7 @@ module BlockHelper
28 }</label></td> 28 }</label></td>
29 <td>#{button_without_text(:delete, _('Remove'), '#', class: 'delete-highlight', data: {confirm: _('Are you sure you want to remove this highlight')})}</td> 29 <td>#{button_without_text(:delete, _('Remove'), '#', class: 'delete-highlight', data: {confirm: _('Are you sure you want to remove this highlight')})}</td>
30 </tr> 30 </tr>
31 - " 31 + ".html_safe
32 end 32 end
33 33
34 end 34 end
test/integration/safe_strings_test.rb
@@ -155,4 +155,12 @@ class SafeStringsTest &lt; ActionDispatch::IntegrationTest @@ -155,4 +155,12 @@ class SafeStringsTest &lt; ActionDispatch::IntegrationTest
155 get url_for(action: :edit, controller: :profile_design, profile: person.identifier, id: block.id) 155 get url_for(action: :edit, controller: :profile_design, profile: person.identifier, id: block.id)
156 assert_select '.block-config-options .other-block' 156 assert_select '.block-config-options .other-block'
157 end 157 end
  158 +
  159 + should 'not escape edit settings in highlight block' do
  160 + login user.login, 'test'
  161 + block = HighlightsBlock.new
  162 + person.boxes.first.blocks << block
  163 + get url_for(action: :edit, controller: :profile_design, profile: person.identifier, id: block.id)
  164 + assert_select '.block-config-options .image-data-line'
  165 + end
158 end 166 end