From 477d2b26b70da91e451ecdedec0809e58bad3ce1 Mon Sep 17 00:00:00 2001 From: DanielVajnagi <82052651+DanielVajnagi@users.noreply.github.com> Date: Mon, 20 Jan 2025 09:46:27 +0200 Subject: [PATCH] remove instance variable in tests --- .../calculators/calculators_helper_spec.rb | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/spec/helpers/calculators/calculators_helper_spec.rb b/spec/helpers/calculators/calculators_helper_spec.rb index 85a1c4e38..394a6c718 100644 --- a/spec/helpers/calculators/calculators_helper_spec.rb +++ b/spec/helpers/calculators/calculators_helper_spec.rb @@ -1,5 +1,3 @@ -require "rails_helper" - RSpec.describe ApplicationHelper, type: :helper do describe "#sanitized_notes" do let(:valid_html) do @@ -14,30 +12,31 @@ '
This is bold and Link
' end + let(:html_with_attributes) do + '' + end + + let(:result) { |html| helper.sanitized_notes(html) } + it "allows specific tags and attributes" do - result = helper.sanitized_notes(valid_html) - expect(result).to include('') - expect(result).to include("bold") - expect(result).to include("italic") - expect(result).to include('Link') + expect(result(valid_html)).to include('
') + expect(result(valid_html)).to include("bold") + expect(result(valid_html)).to include("italic") + expect(result(valid_html)).to include('Link') end it "removes disallowed tags" do - result = helper.sanitized_notes(invalid_html) - expect(result).not_to include("