2022-11-02 09:41:30 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
describe Jobs::EmailChatNotifications do
|
|
|
|
before { Jobs.run_immediately! }
|
|
|
|
|
|
|
|
context "when chat is enabled" do
|
|
|
|
before { SiteSetting.chat_enabled = true }
|
|
|
|
|
|
|
|
it "starts the mailer" do
|
|
|
|
Chat::ChatMailer.expects(:send_unread_mentions_summary)
|
|
|
|
|
|
|
|
Jobs.enqueue(:email_chat_notifications)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "when chat is not enabled" do
|
2022-12-13 19:25:19 -05:00
|
|
|
before { SiteSetting.chat_enabled = false }
|
|
|
|
|
2022-11-02 09:41:30 -04:00
|
|
|
it "does nothing" do
|
|
|
|
Chat::ChatMailer.expects(:send_unread_mentions_summary).never
|
|
|
|
|
|
|
|
Jobs.enqueue(:email_chat_notifications)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|