search: support repeated parent: metatags.

Support using the parent: metatag twice in the same search ("parent:1 parent:2").
This commit is contained in:
evazion
2020-04-19 15:51:03 -05:00
parent 43067703b0
commit 53e5d96bb0
2 changed files with 27 additions and 21 deletions

View File

@@ -227,9 +227,18 @@ class PostQueryBuilderTest < ActiveSupport::TestCase
assert_tag_match([parent], "parent:none")
assert_tag_match([child], "-parent:none")
assert_tag_match([child], "parent:any")
assert_tag_match([parent], "-parent:any")
assert_tag_match([child, parent], "parent:#{parent.id}")
assert_tag_match([child], "parent:#{child.id}")
assert_tag_match([], "-parent:#{parent.id}")
assert_tag_match([], "-parent:#{child.id}")
assert_tag_match([child], "parent:#{parent.id} parent:#{child.id}")
assert_tag_match([child], "child:none")
assert_tag_match([parent], "child:any")
end