discourse/plugins/chat/spec/jobs/scheduled/email_chat_notifications_spec.rb
Blake Erickson 5c925f2db3
FEATURE: Chat and Sidebar are now on by default (#19406)
FEATURE: Chat and Sidebar are now on by default

- Set the sidebar site setting to be enabled by default
- Set the chat site setting to be enabled by default
- Updated existing specs that assumed the original default
- Use a migration to keep old defaults for existing sites
2022-12-13 17:25:19 -07:00

26 lines
593 B
Ruby

# 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
before { SiteSetting.chat_enabled = false }
it "does nothing" do
Chat::ChatMailer.expects(:send_unread_mentions_summary).never
Jobs.enqueue(:email_chat_notifications)
end
end
end