Sha256: 7334e33117bf70120316f76735e2dc3b437cefa47cc2544d601330bc2e6b1d82
Contents?: true
Size: 1.16 KB
Versions: 26
Compression:
Stored size: 1.16 KB
Contents
require "spec_helper" describe NotifyUser::NotificationMailer do describe "notification_email" do let(:user) { User.new({email: "user@example.com" })} let(:notification) { NewPostNotification.new({target: user}) } let(:mailer) { NotifyUser::NotificationMailer.send(:new, 'notification_email', notification, ActionMailerChannel.default_options) } let(:mail) { mailer.notification_email(notification, ActionMailerChannel.default_options) } before :each do NotifyUser::BaseNotification.stub(:find).and_return(notification) end it "renders the headers" do mail.subject.should eq(ActionMailerChannel.default_options[:subject]) mail.to.should eq([user.email]) mail.from.should eq([NotifyUser.mailer_sender]) end it "renders a template to render the notification's template as a partial" do mailer_should_render_template(mailer, "notify_user/action_mailer/notification") mail end it "renders with a layout" do NotifyUser::NotificationMailer.any_instance.stub(:notification).and_return(notification) mail.body.raw_source.should include "This is the default generated layout" end end end
Version data entries
26 entries across 26 versions & 1 rubygems