mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Fix all the errors to get our tests green on Rails 5.1.
This commit is contained in:
19
spec/requests/robots_txt_controller_spec.rb
Normal file
19
spec/requests/robots_txt_controller_spec.rb
Normal file
@ -0,0 +1,19 @@
|
||||
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
|
Reference in New Issue
Block a user