mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-17 19:12:37 -05:00
Add tests for X-Robots-Tag
This commit is contained in:
parent
2f0bd6294c
commit
470d9418fd
1 changed files with 15 additions and 0 deletions
|
@ -1018,4 +1018,19 @@ describe TopicsController do
|
|||
expect(json["banner_count"]).to eq(1)
|
||||
end
|
||||
end
|
||||
|
||||
describe "x-robots-tag" do
|
||||
it "is included for unlisted topics" do
|
||||
topic = Fabricate(:topic, visible: false)
|
||||
get :show, topic_id: topic.id, slug: topic.slug
|
||||
|
||||
expect(response.headers['X-Robots-Tag']).to eq('noindex')
|
||||
end
|
||||
it "is not included for normal topics" do
|
||||
topic = Fabricate(:topic, visible: true)
|
||||
get :show, topic_id: topic.id, slug: topic.slug
|
||||
|
||||
expect(response.headers['X-Robots-Tag']).to eq(nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue