mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
Add extra spec for topic_query
This commit is contained in:
parent
5dd9009718
commit
554d15fdd4
1 changed files with 4 additions and 0 deletions
|
@ -149,6 +149,10 @@ describe TopicQuery 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])
|
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
|
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
|
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])
|
expect(TopicQuery.new(moderator, no_tags: true).list_latest.topics.map(&:id)).to eq([no_tags_topic.id])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue