add test case for searching for >6 tags

This commit is contained in:
albert
2013-02-21 11:38:38 -05:00
parent aafcf34461
commit 7ccf663f48

View File

@@ -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