post queries: raise error on invalid searches.
Raise an error if the search is invalid for one of the following reasons: * It contains multiple conflicting order: metatags (e.g. `order:score order:favcount` or `ordfav:a ordfav:b`). * It contains a metatag that can't be used more than once: (e.g. `limit:5 limit:10`, `random:5 random:10`). * It contains a metatag that can't be negated (e.g. `-order:score`, `-limit:20`, or `-random:20`). * It contains a metatag that can't be used in an OR clause (e.g. ` touhou or order:score`, `touhou or limit:20`, `touhou or random:20`).
This commit is contained in:
@@ -82,7 +82,7 @@ module PostSets
|
||||
should "fail" do
|
||||
@set = PostSets::Post.new("a b c", user: create(:user))
|
||||
|
||||
assert_raises(PostQueryBuilder::TagLimitError) do
|
||||
assert_raises(PostQuery::TagLimitError) do
|
||||
@set.posts
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user