prefix the robots.txt rules with the directory when using subfolder

This commit is contained in:
Régis Hanol
2018-04-11 22:05:02 +02:00
parent 3c8b43bb01
commit df7970a6f6
4 changed files with 49 additions and 35 deletions

View File

@ -3,6 +3,14 @@ require 'rails_helper'
RSpec.describe RobotsTxtController do
describe '#index' do
context 'subfolder' do
it 'prefixes the rules with the directory' do
Discourse.stubs(:base_uri).returns('/forum')
get '/robots.txt'
expect(response.body).to include("\nDisallow: /forum/admin")
end
end
context 'crawl delay' do
it 'allows you to set crawl delay on particular bots' do
SiteSetting.allow_index_in_robots_txt = true