From 554d15fdd406c77b1865abe8012d52dce579d146 Mon Sep 17 00:00:00 2001 From: James Kiesel Date: Mon, 15 Aug 2016 15:42:06 -0400 Subject: [PATCH] Add extra spec for topic_query --- spec/components/topic_query_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/components/topic_query_spec.rb b/spec/components/topic_query_spec.rb index 32b8d814421..6506377d494 100644 --- a/spec/components/topic_query_spec.rb +++ b/spec/components/topic_query_spec.rb @@ -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]) 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