artists: prevent Google from indexing banned artists.
Prevent search engines from indexing artist pages, wiki pages, and tag searches for banned artists.
This commit is contained in:
@@ -65,6 +65,14 @@ class ArtistsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_response :success
|
||||
assert_select ".artist-wiki", count: 0
|
||||
end
|
||||
|
||||
should "mark banned artists as noindex" do
|
||||
@artist = create(:artist, is_banned: true)
|
||||
get artist_path(@artist.id)
|
||||
|
||||
assert_response :success
|
||||
assert_select "meta[name=robots][content=noindex]"
|
||||
end
|
||||
end
|
||||
|
||||
context "new action" do
|
||||
|
||||
@@ -112,6 +112,16 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_select "#view-artist-link", count: 0
|
||||
end
|
||||
|
||||
should "render for a banned artist tag" do
|
||||
artist = create(:artist, is_banned: true)
|
||||
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]"
|
||||
end
|
||||
|
||||
should "render for a tag with a wiki page" do
|
||||
create(:post, tag_string: "char:fumimi", rating: "s")
|
||||
get posts_path, params: { tags: "fumimi" }
|
||||
|
||||
@@ -121,6 +121,14 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
|
||||
get wiki_page_path("....xml")
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
should "mark banned artists as noindex" do
|
||||
@artist = create(:artist, name: @wiki_page.title, is_banned: true)
|
||||
get wiki_page_path(@wiki_page.title)
|
||||
|
||||
assert_response :success
|
||||
assert_select "meta[name=robots][content=noindex]"
|
||||
end
|
||||
end
|
||||
|
||||
context "show_or_new action" do
|
||||
|
||||
Reference in New Issue
Block a user