From 9a299aeeb5cc9cfd0865a9cbe92868351e16800f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 9 Oct 2019 17:37:39 +0200 Subject: [PATCH] Fix checkbox label containing links The link tags were being stripped out by `content_tag`. --- lib/consul_form_builder.rb | 2 +- spec/features/budgets/investments_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/consul_form_builder.rb b/lib/consul_form_builder.rb index 2433e867d..e5b77f69d 100644 --- a/lib/consul_form_builder.rb +++ b/lib/consul_form_builder.rb @@ -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 diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb index 034691e50..40b03d8dd 100644 --- a/spec/features/budgets/investments_spec.rb +++ b/spec/features/budgets/investments_spec.rb @@ -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"