Fix checkbox label containing links

The link tags were being stripped out by `content_tag`.
This commit is contained in:
Javi Martín
2019-10-09 17:37:39 +02:00
parent 6b1864fbcd
commit 9a299aeeb5
2 changed files with 2 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ class ConsulFormBuilder < FoundationRailsHelper::FormBuilder
def check_box(attribute, options = {})
if options[:label] != false
label = content_tag(:span, label_text(object, attribute, options[:label]), class: "checkbox")
label = content_tag(:span, sanitize(label_text(object, attribute, options[:label]), class: "checkbox"))
super(attribute, options.merge(label: label, label_options: label_options_for(options)))
else

View File

@@ -874,7 +874,7 @@ describe "Budget Investments" do
fill_in "Title", with: "I am a bot"
fill_in "budget_investment_subtitle", with: "This is the honeypot"
fill_in "Description", with: "This is the description"
check "budget_investment_terms_of_service"
check "I agree to the Privacy Policy and the Terms and conditions of use"
click_button "Create Investment"