From 7ccf663f48ef1319f712f901f3d168925fcca7db Mon Sep 17 00:00:00 2001 From: albert Date: Thu, 21 Feb 2013 11:38:38 -0500 Subject: [PATCH] add test case for searching for >6 tags --- test/unit/post_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unit/post_test.rb b/test/unit/post_test.rb index 6e64d1340..2edd98272 100644 --- a/test/unit/post_test.rb +++ b/test/unit/post_test.rb @@ -835,6 +835,14 @@ class PostTest < ActiveSupport::TestCase assert_equal(post3.id, relation.first.id) end + should "fail for more than 6 tags" do + post1 = FactoryGirl.create(:post, :rating => "s") + + assert_raise(::Post::SearchError) do + Post.tag_match("a b c rating:s width:10 height:10 user:bob") + end + end + should "succeed for exclusive tag searches with no other tag" do post1 = FactoryGirl.create(:post, :rating => "s", :tag_string => "aaa") assert_nothing_raised do