mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 21:57:50 +08:00
FEATURE: allow user to override watched_precedence_over_muted setting (#22340)
Recently, site setting watched_precedence_over_muted was introduced - https://github.com/discourse/discourse/pull/22252 In this PR, we are allowing users to override it. The option is only displayed when the user has watched categories and muted tags, or vice versa.
This commit is contained in:

committed by
GitHub

parent
82d6420e31
commit
134dcdd63a
@ -2160,5 +2160,18 @@ RSpec.describe TopicQuery do
|
||||
expect(query.topics.map(&:id)).to contain_exactly(topic.id)
|
||||
end
|
||||
end
|
||||
|
||||
context "when disabled but overridden by user" do
|
||||
it "returns topics even if category or tag is muted but another tag or category is watched" do
|
||||
SiteSetting.watched_precedence_over_muted = false
|
||||
user.user_option.update!(watched_precedence_over_muted: true)
|
||||
query = TopicQuery.new(user).list_latest
|
||||
expect(query.topics.map(&:id)).to contain_exactly(
|
||||
topic.id,
|
||||
topic_in_watched_category_and_muted_tag.id,
|
||||
topic_in_muted_category_and_watched_tag.id,
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user