Sha256: c0f7eae9bcf49d3ab2afdc801c7bfe1e3f8d8737c8efd80bd70fde3cc6c655b7
Contents?: true
Size: 946 Bytes
Versions: 4
Compression:
Stored size: 946 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, name: "O'Higgins", 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=\"#{decidim_escape_translated(organization.name)}\"") expect(mail.body).to match(%r{https{0,1}://#{organization.host}:#{Capybara.server_port}#{logo_path}}) end end end
Version data entries
4 entries across 4 versions & 1 rubygems