From dd659f16c06b1d004dd0a9afbbb5241ec3c49f4d Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 9 Jun 2022 15:55:28 +1000 Subject: [PATCH] Correct method name for shop logo in email --- .../placement_summary_email.html.haml | 2 +- spec/mailers/subscription_mailer_spec.rb | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/subscription_mailer/placement_summary_email.html.haml b/app/views/subscription_mailer/placement_summary_email.html.haml index 3c8a21baca..4cdefdffe1 100644 --- a/app/views/subscription_mailer/placement_summary_email.html.haml +++ b/app/views/subscription_mailer/placement_summary_email.html.haml @@ -12,7 +12,7 @@ %tr %td{:align => "right"} - if @shop.logo.variable? - = image_tag @shop.logo_variant(:medium), class: "float-right" + = image_tag @shop.logo_url(:medium), class: "float-right" %span.clear = render 'summary_overview', summary: @summary diff --git a/spec/mailers/subscription_mailer_spec.rb b/spec/mailers/subscription_mailer_spec.rb index bcfb0d87ec..d0b6de958a 100644 --- a/spec/mailers/subscription_mailer_spec.rb +++ b/spec/mailers/subscription_mailer_spec.rb @@ -240,15 +240,22 @@ describe SubscriptionMailer, type: :mailer do allow(summary).to receive(:order_count) { 37 } allow(summary).to receive(:issue_count) { 0 } allow(summary).to receive(:issues) { {} } - SubscriptionMailer.placement_summary_email(summary).deliver_now end it "sends the email, which notifies the enterprise that all orders were successfully processed" do + SubscriptionMailer.placement_summary_email(summary).deliver_now + expect(body).to include I18n.t("#{scope}.placement_summary_email.intro", shop: shop.name) expect(body).to include I18n.t("#{scope}.summary_overview.total", count: 37) expect(body).to include I18n.t("#{scope}.summary_overview.success_all") expect(body).to_not include I18n.t("#{scope}.summary_overview.issues") end + + it "renders the shop's logo" do + shop.update!(logo: fixture_file_upload("logo.png", "image/png")) + SubscriptionMailer.placement_summary_email(summary).deliver_now + expect(SubscriptionMailer.deliveries.last.body).to include "logo.png" + end end context "when some issues were encountered while processing subscriptions" do