posts: show takedown page for banned artists and posts.

Show a "This page has been removed because of a takedown request" error when
an unauthorized user searches for a banned tag, or tries to view a banned post.
This commit is contained in:
evazion
2022-05-03 05:23:41 -05:00
parent 48b8daa397
commit 2219a64f47
8 changed files with 19 additions and 7 deletions

View File

@@ -104,8 +104,7 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
artist.update(is_banned: true)
get posts_path, params: { tags: "bkub" }
assert_response :success
assert_select "#show-excerpt-link", count: 1, text: "Artist"
assert_response 451
artist.update(is_banned: false, is_deleted: true)
get posts_path, params: { tags: "bkub" }
@@ -125,9 +124,7 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
create(:post, tag_string: artist.name)
get posts_path, params: { tags: artist.name }
assert_response :success
assert_select "#show-excerpt-link", count: 1, text: "Artist"
assert_select "meta[name=robots][content=noindex]"
assert_response 451
end
should "render for a tag with a wiki page" do