Merge pull request #3245 from evazion/fix-2344

Fix #2344: Negating status metatag breaks deleted post filter.
This commit is contained in:
Albert Yi
2017-07-31 12:50:21 -07:00
committed by GitHub
2 changed files with 22 additions and 1 deletions

View File

@@ -1972,6 +1972,17 @@ class PostTest < ActiveSupport::TestCase
assert_tag_match(all - [flagged], "-status:active")
end
should "respect the 'Deleted post filter' option when using the status:banned metatag" do
deleted = FactoryGirl.create(:post, is_deleted: true, is_banned: true)
undeleted = FactoryGirl.create(:post, is_banned: true)
CurrentUser.hide_deleted_posts = true
assert_tag_match([undeleted], "status:banned")
CurrentUser.hide_deleted_posts = false
assert_tag_match([undeleted, deleted], "status:banned")
end
should "return posts for the filetype:<ext> metatag" do
png = FactoryGirl.create(:post, file_ext: "png")
jpg = FactoryGirl.create(:post, file_ext: "jpg")