search: fix bug with negated user metatags.

Bug: searching for "filetype:jpg -user:evazion" would negate the
filetype:jpg metatag too. This was because the -user:<name> metatag was
negating the entire cumulative relation instead of just the user:<name>
clause.
This commit is contained in:
evazion
2020-04-17 00:29:09 -05:00
parent 99e7e359af
commit c1ce5024e4
2 changed files with 55 additions and 51 deletions

View File

@@ -2141,6 +2141,7 @@ class PostTest < ActiveSupport::TestCase
assert_tag_match([posts[0]], "user:#{users[0].name}")
assert_tag_match([posts[1]], "-user:#{users[0].name}")
assert_tag_match([posts[1]], "filetype:jpg -user:#{users[0].name}")
end
should "return posts for the approver:<name> metatag" do