Skip to content

Commit

Permalink
fix 26 spec
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Nov 6, 2024
1 parent e18b716 commit 0b0220e
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions spec/cells/content_blocks/map_cell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0b0220e

Please sign in to comment.