2015-10-11 05:41:23 -04:00
|
|
|
require 'rails_helper'
|
2013-02-10 19:02:57 -05:00
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
RSpec.describe RobotsTxtController do
|
|
|
|
describe '#index' do
|
2013-02-25 17:58:16 -05:00
|
|
|
it "returns index when indexing is allowed" do
|
2015-06-03 06:14:00 -04:00
|
|
|
SiteSetting.allow_index_in_robots_txt = true
|
2017-08-31 00:06:56 -04:00
|
|
|
get '/robots.txt'
|
|
|
|
|
|
|
|
expect(response.body).to include("Disallow: /u/")
|
2013-02-10 19:02:57 -05:00
|
|
|
end
|
|
|
|
|
2013-02-26 10:42:49 -05:00
|
|
|
it "returns noindex when indexing is disallowed" do
|
2015-06-03 06:14:00 -04:00
|
|
|
SiteSetting.allow_index_in_robots_txt = false
|
2017-08-31 00:06:56 -04:00
|
|
|
get '/robots.txt'
|
2013-02-25 11:42:20 -05:00
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
expect(response.body).to_not include("Disallow: /u/")
|
|
|
|
end
|
2013-02-10 19:02:57 -05:00
|
|
|
end
|
|
|
|
end
|