Sha256: c6730879d56534914069657e70896e4f31f114967b853ddebdca84f4e735ddce

Contents?: true

Size: 1.18 KB

Versions: 48

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe Spree::ReimbursementMailer, type: :mailer do
  let(:reimbursement) { create(:reimbursement) }

  it "accepts a reimbursement id as an alternative to a Reimbursement object" do
    expect(Spree::Reimbursement).to receive(:find).with(reimbursement.id).and_return(reimbursement)

    Spree::ReimbursementMailer.reimbursement_email(reimbursement.id).body
  end

  context "emails must be translatable" do
    context "reimbursement_email" do
      context "pt-BR locale" do
        before do
          I18n.enforce_available_locales = false
          pt_br_shipped_email = { spree: { reimbursement_mailer: { reimbursement_email: { dear_customer: 'Caro Cliente,' } } } }
          I18n.backend.store_translations :'pt-BR', pt_br_shipped_email
          I18n.locale = :'pt-BR'
        end

        after do
          I18n.locale = I18n.default_locale
          I18n.enforce_available_locales = true
        end

        specify do
          reimbursement_email = Spree::ReimbursementMailer.reimbursement_email(reimbursement)
          expect(reimbursement_email.parts.first.body).to include("Caro Cliente,")
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
solidus_core-2.10.5 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.10.3 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.10.2 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.9.6 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.8.6 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.10.1 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.9.5 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.10.0 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.9.4 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.6.6 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.7.4 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.8.5 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.9.3 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.9.2 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.10.0.beta1 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.7.3 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.6.5 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.9.1 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.9.0 spec/mailers/reimbursement_mailer_spec.rb
solidus_core-2.9.0.rc.1 spec/mailers/reimbursement_mailer_spec.rb