search: add synonyms for *_count metatags.

Allow e.g. `deleted_comments` as a synonym for `deleted_comment_count`.
This commit is contained in:
evazion
2018-12-11 18:10:20 -06:00
parent b1335616dd
commit ea9c3576d8
2 changed files with 24 additions and 2 deletions

View File

@@ -2111,6 +2111,10 @@ class PostTest < ActiveSupport::TestCase
assert_tag_match([posts[1], posts[0]], "note_count:1")
assert_tag_match([posts[0]], "active_note_count:1")
assert_tag_match([posts[1]], "deleted_note_count:1")
assert_tag_match([posts[1], posts[0]], "notes:1")
assert_tag_match([posts[0]], "active_notes:1")
assert_tag_match([posts[1]], "deleted_notes:1")
end
should "return posts for the artcomm:<name> metatag" do
@@ -2418,6 +2422,8 @@ class PostTest < ActiveSupport::TestCase
assert_tag_match(posts.reverse, "order:rank")
assert_tag_match(posts.reverse, "order:note_count")
assert_tag_match(posts.reverse, "order:note_count_desc")
assert_tag_match(posts.reverse, "order:notes")
assert_tag_match(posts.reverse, "order:notes_desc")
assert_tag_match(posts, "order:id_asc")
assert_tag_match(posts, "order:score_asc")
@@ -2436,6 +2442,7 @@ class PostTest < ActiveSupport::TestCase
assert_tag_match(posts, "order:chartags_asc")
assert_tag_match(posts, "order:copytags_asc")
assert_tag_match(posts, "order:note_count_asc")
assert_tag_match(posts, "order:notes_asc")
end
should "return posts for order:comment_bumped" do