Sha256: 76401ee9cd75b4c4b54ba49fc5d8ea2c014228602b752d963eee105c50f5dc7f

Contents?: true

Size: 900 Bytes

Versions: 16

Compression:

Stored size: 900 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

shared_examples "email with logo" do
  context "when organization has a logo" do
    let(:organization_logo) { Decidim::Dev.test_file("city.jpeg", "image/jpeg") }
    let(:organization) { create(:organization, logo: organization_logo) }
    let(:mail) { described_class.event_received(event, event_class_name, resource, user, :follower, extra) }
    let(:logo_path) { Rails.application.routes.url_helpers.rails_representation_path(organization.logo.variant(resize_to_fit: [600, 160]), only_path: true) }

    it "includes organization logo" do
      expect(mail.body).to include(logo_path)
    end

    it "includes organization logo with full link" do
      expect(mail.body).to include("alt=\"#{organization.name}\"")
      expect(mail.body).to match(%r{https{0,1}://#{organization.host}:#{Capybara.server_port}#{logo_path}})
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
decidim-core-0.27.9 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.27.8 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.27.7 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.28.1 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.27.6 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.28.0 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.27.5 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.28.0.rc5 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.28.0.rc4 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.27.4 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.27.3 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.27.2 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.27.1 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.27.0 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.27.0.rc2 lib/decidim/core/test/shared_examples/logo_email.rb
decidim-core-0.27.0.rc1 lib/decidim/core/test/shared_examples/logo_email.rb