Sha256: dac5ee83818d34e22ce026703f4c023aa37d2639a9ff65111f2cca4c9759e5e7

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

require "spec_helper"

shared_examples_for "space cell changes button text CTA" do
  describe "within the card footer" do
    context "when it has no components" do
      it "renders 'More info' in the CTA button text" do
        expect(subject).to have_css(".card__footer--spaces .card__button", text: "More info")
      end
    end

    context "when it has a component" do
      context "and it is not published" do
        let!(:component) { create(:component, :unpublished, manifest_name: "dummy", participatory_space: model) }

        it "renders 'More info' in the CTA button text" do
          expect(subject).to have_css(".card__footer--spaces .card__button", text: "More info")
        end
      end

      context "and it is published" do
        let!(:component) { create(:component, :published, manifest_name: "dummy", participatory_space: model) }

        it "renders 'Take part' in the CTA button text" do
          expect(subject).to have_css(".card__footer--spaces .card__button", text: "Take part")
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-core-0.29.1 lib/decidim/core/test/shared_examples/space_cell_changes_button_text_cta.rb
decidim-core-0.29.0 lib/decidim/core/test/shared_examples/space_cell_changes_button_text_cta.rb
decidim-core-0.29.0.rc4 lib/decidim/core/test/shared_examples/space_cell_changes_button_text_cta.rb
decidim-core-0.29.0.rc3 lib/decidim/core/test/shared_examples/space_cell_changes_button_text_cta.rb
decidim-core-0.29.0.rc2 lib/decidim/core/test/shared_examples/space_cell_changes_button_text_cta.rb
decidim-core-0.29.0.rc1 lib/decidim/core/test/shared_examples/space_cell_changes_button_text_cta.rb