mirror of
https://github.com/discourse/discourse.git
synced 2026-07-30 08:08:20 -05:00
Merge pull request #4387 from gdpelican/feature/tags-intersection
FEATURE: Tags intersection page
This commit is contained in:
@@ -145,6 +145,14 @@ describe TopicQuery do
|
||||
# expect(TopicQuery.new(moderator, tags: [tag.id, other_tag.id]).list_latest.topics.map(&:id)).to eq([tagged_topic3.id].sort)
|
||||
end
|
||||
|
||||
it "can return topics with all specified tags" do
|
||||
expect(TopicQuery.new(moderator, tags: [tag.name, other_tag.name], match_all_tags: true).list_latest.topics.map(&:id)).to eq([tagged_topic3.id])
|
||||
end
|
||||
|
||||
it "returns an empty relation when an invalid tag is passed" do
|
||||
expect(TopicQuery.new(moderator, tags: [tag.name, 'notatag'], match_all_tags: true).list_latest.topics).to be_empty
|
||||
end
|
||||
|
||||
it "can return topics with no tags" do
|
||||
expect(TopicQuery.new(moderator, no_tags: true).list_latest.topics.map(&:id)).to eq([no_tags_topic.id])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user