Feature #37807 » 0002-Always-allow-access-to-robots.txt-for-Anonymous.patch
| app/controllers/welcome_controller.rb | ||
|---|---|---|
|
class WelcomeController < ApplicationController
|
||
|
self.main_menu = false
|
||
|
skip_before_action :check_if_login_required, only: [:robots]
|
||
|
def index
|
||
|
@news = News.latest User.current
|
||
|
end
|
||
| test/integration/welcome_test.rb | ||
|---|---|---|
|
# closed projects are included in the list
|
||
|
assert @response.body.match(%r{^Disallow: /projects/subproject1/issues\r?$})
|
||
|
end
|
||
|
def test_robots_when_login_is_required
|
||
|
with_settings :login_required => '1' do
|
||
|
get '/robots.txt'
|
||
|
assert_response :success
|
||
|
assert_equal 'text/plain', @response.media_type
|
||
|
end
|
||
|
end
|
||
|
end
|
||