diff --git a/app/logical/post_query_builder.rb b/app/logical/post_query_builder.rb index e31a939f1..306663517 100644 --- a/app/logical/post_query_builder.rb +++ b/app/logical/post_query_builder.rb @@ -912,8 +912,9 @@ class PostQueryBuilder metatags end + # XXX unify with PostSets::Post#show_deleted? def hide_deleted? - has_status_metatag = select_metatags(:status).any? { |metatag| metatag.value.downcase.in?(%w[deleted active any all]) } + has_status_metatag = select_metatags(:status).any? { |metatag| metatag.value.downcase.in?(%w[deleted active any all unmoderated modqueue appealed]) } hide_deleted_posts? && !has_status_metatag end end diff --git a/test/functional/posts_controller_test.rb b/test/functional/posts_controller_test.rb index af6eb6360..89431f69d 100644 --- a/test/functional/posts_controller_test.rb +++ b/test/functional/posts_controller_test.rb @@ -373,6 +373,18 @@ class PostsControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_select "#post_#{@post.id}", 1 end + + context "with the hide_deleted_posts option enabled" do + should "show deleted posts when searching for status:appealed" do + @user.update!(hide_deleted_posts: true) + create(:post_appeal, post: @post) + + get_auth posts_path(tags: "status:appealed"), @user + + assert_response :success + assert_select "#post_#{@post.id}", 1 + end + end end context "with restricted posts" do