mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 19:03:13 +08:00
20 lines
488 B
Ruby
20 lines
488 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe RobotsTxtController do
|
|
describe '#index' do
|
|
it "returns index when indexing is allowed" do
|
|
SiteSetting.allow_index_in_robots_txt = true
|
|
get '/robots.txt'
|
|
|
|
expect(response.body).to include("Disallow: /u/")
|
|
end
|
|
|
|
it "returns noindex when indexing is disallowed" do
|
|
SiteSetting.allow_index_in_robots_txt = false
|
|
get '/robots.txt'
|
|
|
|
expect(response.body).to_not include("Disallow: /u/")
|
|
end
|
|
end
|
|
end
|