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