Files
openfoodnetwork/spec/mailers/enterprise_mailer_spec.rb
2014-10-17 12:29:51 +11:00

16 lines
490 B
Ruby

require 'spec_helper'
describe EnterpriseMailer do
let!(:enterprise) { create(:enterprise) }
before do
ActionMailer::Base.deliveries = []
end
it "should send an email confirmation when given an enterprise" do
EnterpriseMailer.confirmation_instructions(enterprise, 'token').deliver
ActionMailer::Base.deliveries.count.should == 1
mail = ActionMailer::Base.deliveries.first
expect(mail.subject).to eq "Please confirm your email for #{enterprise.name}"
end
end