mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Do not return muted child categories termless hashtag search (#19526)
We generally do not return muted child categories to the user if they have muted the parent category, this commit respects that rule for CategoryHashtagDataSource
This commit is contained in:
@@ -91,6 +91,15 @@ RSpec.describe CategoryHashtagDataSource do
|
||||
)
|
||||
expect(described_class.search_without_term(guardian, 5).map(&:slug)).not_to include("random")
|
||||
end
|
||||
|
||||
it "does not return child categories where the user has muted the parent" do
|
||||
CategoryUser.create!(
|
||||
user: user,
|
||||
category: parent_category,
|
||||
notification_level: CategoryUser.notification_levels[:muted],
|
||||
)
|
||||
expect(described_class.search_without_term(guardian, 5).map(&:slug)).not_to include("random")
|
||||
end
|
||||
end
|
||||
|
||||
describe "#search_sort" do
|
||||
|
||||
Reference in New Issue
Block a user