"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spec/components/email/sender_spec.rb" between
discourse-2.5.2.tar.gz and discourse-2.5.3.tar.gz

About: Discourse is a "next-generation" forum platform for community discussions.

sender_spec.rb  (discourse-2.5.2):sender_spec.rb  (discourse-2.5.3)
skipping to change at line 52 skipping to change at line 52
Mail::Message.any_instance.expects(:deliver_now).never Mail::Message.any_instance.expects(:deliver_now).never
message = Mail::Message.new(to: user.email, body: "hello") message = Mail::Message.new(to: user.email, body: "hello")
expect(Email::Sender.new(message, :hello).send).to eq(nil) expect(Email::Sender.new(message, :hello).send).to eq(nil)
end end
it "delivers mail to staff user" do it "delivers mail to staff user" do
Mail::Message.any_instance.expects(:deliver_now).once Mail::Message.any_instance.expects(:deliver_now).once
message = Mail::Message.new(to: moderator.email, body: "hello") message = Mail::Message.new(to: moderator.email, body: "hello")
Email::Sender.new(message, :hello).send Email::Sender.new(message, :hello).send
end end
it "delivers mail to staff user when confirming new email if user is provi
ded" do
Mail::Message.any_instance.expects(:deliver_now).once
Fabricate(:email_change_request, {
user: moderator,
new_email: "newemail@testmoderator.com",
old_email: moderator.email,
change_state: EmailChangeRequest.states[:authorizing_new]
})
message = Mail::Message.new(
to: "newemail@testmoderator.com", body: "hello"
)
Email::Sender.new(message, :confirm_new_email, moderator).send
end
end end
end end
it "doesn't deliver mail when the message is of type NullMail" do it "doesn't deliver mail when the message is of type NullMail" do
Mail::Message.any_instance.expects(:deliver_now).never Mail::Message.any_instance.expects(:deliver_now).never
message = ActionMailer::Base::NullMail.new message = ActionMailer::Base::NullMail.new
expect(Email::Sender.new(message, :hello).send).to eq(nil) expect(Email::Sender.new(message, :hello).send).to eq(nil)
end end
it "doesn't deliver mail when the message is nil" do it "doesn't deliver mail when the message is nil" do
 End of changes. 1 change blocks. 
0 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)