mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Respect muted tags for mailing list mode
If a user has a tag muted, don't send them emails about that tag. We've done this forever for categories so it makes sense to do it for tags too.
This commit is contained in:
@@ -7,9 +7,14 @@ describe Jobs::NotifyMailingListSubscribers do
|
||||
fab!(:mailing_list_user) { Fabricate(:user) }
|
||||
|
||||
before { mailing_list_user.user_option.update(mailing_list_mode: true, mailing_list_mode_frequency: 1) }
|
||||
before do
|
||||
SiteSetting.tagging_enabled = true
|
||||
end
|
||||
|
||||
fab!(:tag) { Fabricate(:tag) }
|
||||
fab!(:topic) { Fabricate(:topic, tags: [tag]) }
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:post) { Fabricate(:post, user: user) }
|
||||
fab!(:post) { Fabricate(:post, topic: topic, user: user) }
|
||||
|
||||
shared_examples "no emails" do
|
||||
it "doesn't send any emails" do
|
||||
@@ -127,6 +132,11 @@ describe Jobs::NotifyMailingListSubscribers do
|
||||
include_examples "no emails"
|
||||
end
|
||||
|
||||
context "from a muted tag" do
|
||||
before { TagUser.create(user: mailing_list_user, tag: tag, notification_level: TagUser.notification_levels[:muted]) }
|
||||
include_examples "no emails"
|
||||
end
|
||||
|
||||
context "max emails per day was reached" do
|
||||
before { SiteSetting.max_emails_per_day_per_user = 2 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user