FEATURE: add noindex header to tags pages (#9748)

This commit is contained in:
Joshua Rosenfeld 2020-05-12 10:44:46 -04:00 committed by GitHub
parent 9bce91f59f
commit c94e6a9a66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,8 @@ class TagsController < ::ApplicationController
before_action :fetch_tag, only: [:info, :create_synonyms, :destroy_synonym]
after_action :add_noindex_header
def index
@description_meta = I18n.t("tags.title")
@title = @description_meta

View File

@ -29,6 +29,7 @@ describe TagsController do
tags = response.parsed_body["tags"]
expect(tags.length).to eq(1)
expect(tags[0]['text']).to eq("topic-test")
expect(response.headers['X-Robots-Tag']).to eq('noindex')
end
end