From 0b0220e82332a8acc850453409ceec0c16fdbd30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Verg=C3=A9s?= Date: Wed, 6 Nov 2024 15:53:48 +0100 Subject: [PATCH] fix 26 spec --- spec/cells/content_blocks/map_cell_spec.rb | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/spec/cells/content_blocks/map_cell_spec.rb b/spec/cells/content_blocks/map_cell_spec.rb index 0fd17eed..436b15e1 100644 --- a/spec/cells/content_blocks/map_cell_spec.rb +++ b/spec/cells/content_blocks/map_cell_spec.rb @@ -49,10 +49,8 @@ module Decidim::DecidimAwesome end it "uses all components" do - components = subject.to_s.match(/data-components="([^"]+)"/)[1] - - expect(components).to include("":#{meeting_component.id},") - expect(components).to include("":#{proposal_component.id},") + expect(components).to include("#{quot}:#{meeting_component.id},") + expect(components).to include("#{quot}:#{proposal_component.id},") end it "uses all categories" do @@ -130,11 +128,25 @@ module Decidim::DecidimAwesome end it "uses its own components" do - components = subject.to_s.match(/data-components="([^"]+)"/)[1] + expect(components).not_to include("#{quot}:#{meeting_component.id},") + expect(components).not_to include("#{quot}:#{proposal_component.id},") + expect(components).to include("#{quot}:#{another_meeting_component.id},") + end + end + + def components + if legacy_version? + subject.to_s.match(/data-components='([^']+)'/)[1] + else + subject.to_s.match(/data-components="([^"]+)"/)[1] + end + end - expect(components).not_to include("":#{meeting_component.id},") - expect(components).not_to include("":#{proposal_component.id},") - expect(components).to include("":#{another_meeting_component.id},") + def quot + if legacy_version? + "\"" + else + """ end end end