Sha256: 6bebc63ed933839c331b26c45dd6b4656d02eb33972bc333d333e9c64d8b8dc0

Contents?: true

Size: 1.57 KB

Versions: 32

Compression:

Stored size: 1.57 KB

Contents

# frozen_string_literal: true

shared_examples "amendment created event" do
  include_context "when a simple event"

  let(:resource) { amendable }
  let(:event_name) { "decidim.events.amendments.amendment_created" }
  let!(:extra) do
    {
      amendment_id: amendment.id
    }
  end

  it_behaves_like "a simple event"

  let(:amendable_title) { amendable.title }
  let(:emendation_author_nickname) { "@#{emendation.creator_author.nickname}" }
  let(:emendation_path) { Decidim::ResourceLocatorPresenter.new(emendation).path }
  let(:emendation_author_path) { Decidim::UserPresenter.new(emendation.creator_author).profile_path }
  let(:amendable_path) { Decidim::ResourceLocatorPresenter.new(amendable).path }

  describe "email_subject" do
    it "is generated correctly" do
      expect(subject.email_subject).to eq("New amendment for #{amendable_title}")
    end
  end

  describe "email_intro" do
    it "is generated correctly" do
      expect(subject.email_intro)
        .to eq("A new amendment has been created for #{amendable_title}. You can see it from this page:")
    end
  end

  describe "email_outro" do
    it "is generated correctly" do
      expect(subject.email_outro)
        .to eq("You have received this notification because you are following #{amendable_title}. You can stop receiving notifications following the previous link.")
    end
  end

  describe "notification_title" do
    it "is generated correctly" do
      expect(subject.notification_title)
        .to eq("A new amendment has been created for <a href=\"#{amendable_path}\">#{amendable_title}</a>.")
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
decidim-core-0.26.0 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.26.0.rc2 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.26.0.rc1 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.25.2 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.25.1 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.25.0 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.25.0.rc4 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.25.0.rc3 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.25.0.rc2 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.25.0.rc1 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.24.3 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.23.6 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.24.2 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.23.5 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.24.1 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.24.0 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.24.0.rc2 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.23.4 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.24.0.rc1 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb
decidim-core-0.23.3 lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb