2013-02-10 19:02:57 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe RobotsTxtController do
|
|
|
|
|
|
|
|
context '.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
|
2013-02-10 19:02:57 -05:00
|
|
|
get :index
|
2015-01-09 12:04:02 -05:00
|
|
|
expect(response).to render_template :index
|
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
|
2013-02-10 19:02:57 -05:00
|
|
|
get :index
|
2015-01-09 12:04:02 -05:00
|
|
|
expect(response).to render_template :no_index
|
2013-02-25 11:42:20 -05:00
|
|
|
end
|
|
|
|
|
2013-02-10 19:02:57 -05:00
|
|
|
end
|
|
|
|
end
|