vidpush/spec/mailers/videolisting_mailer_spec.rb
2014-05-06 15:45:50 -04:00

22 lines
578 B
Ruby

require "spec_helper"
require "ostruct"
describe VideolistingMailer do
it 'sends an email' do
fake_listing = OpenStruct.new
campaign = OpenStruct.new
campaign.vpa = "John Doe"
campaign.vpa_email = "john@doe.com"
campaign.listingcode = "fakelisting"
fake_listing.campaign = campaign
fake_listing.videocode = "fakelisting-1"
videolisting_mail = VideolistingMailer.videolisting_complete(fake_listing).deliver
expect(videolisting_mail.to).to include("john@doe.com")
expect(ActionMailer::Base.deliveries.empty?).to eq(false)
end
end