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