discourse/spec/requests/robots_txt_controller_spec.rb

20 lines
488 B
Ruby
Raw Normal View History

require 'rails_helper'
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
get '/robots.txt'
expect(response.body).to include("Disallow: /u/")
end
it "returns noindex when indexing is disallowed" do
2015-06-03 06:14:00 -04:00
SiteSetting.allow_index_in_robots_txt = false
get '/robots.txt'
2013-02-25 11:42:20 -05:00
expect(response.body).to_not include("Disallow: /u/")
end
end
end