Sha256: 464b839adfebcd1c2747745ab04296117dcd5323f7e5adb59222cfe82289608c
Contents?: true
Size: 866 Bytes
Versions: 12
Compression:
Stored size: 866 Bytes
Contents
require "rails_helper" describe MnoEnterprise::MailAdapters::SmtpAdapter do describe '.deliver' do before { described_class.instance_variable_set("@client", nil) } let(:template) { :some_template } let(:from) {{ name: "John", email: "j@e.com" }} let(:to) {{ name: "John", email: "j@e.com" }} let(:vars) {{ some: 'var' }} let(:opts) {{ some: 'opt' }} subject { described_class.deliver(template, from, to, vars, opts) } it 'delegates the method to a smtp client' do # Stub SmptClient smtp = double('smtpclient') smtp_mail = double('smtpmail') expect(MnoEnterprise::SmtpClient).to receive(:new).and_return(smtp) expect(smtp).to receive(:deliver).with(template, from, to, vars, opts).and_return(smtp_mail) expect(smtp_mail).to receive(:deliver) subject end end end
Version data entries
12 entries across 12 versions & 1 rubygems