2014-05-05 18:07:33 +00:00
|
|
|
require "spec_helper"
|
2014-05-06 19:45:50 +00:00
|
|
|
require "ostruct"
|
2014-05-05 18:07:33 +00:00
|
|
|
|
|
|
|
describe VideolistingMailer do
|
2014-05-06 19:45:50 +00:00
|
|
|
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
|
2014-05-05 18:07:33 +00:00
|
|
|
end
|