diff options
-rw-r--r-- | app/controllers/welcome_controller.rb | 2 | ||||
-rw-r--r-- | test/integration/welcome_test.rb | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index e526fe5b1..0807c8232 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -20,6 +20,8 @@ class WelcomeController < ApplicationController self.main_menu = false + skip_before_action :check_if_login_required, only: [:robots] + def index @news = News.latest User.current end diff --git a/test/integration/welcome_test.rb b/test/integration/welcome_test.rb index ffb3e240f..1f46cd469 100644 --- a/test/integration/welcome_test.rb +++ b/test/integration/welcome_test.rb @@ -42,4 +42,12 @@ class WelcomeTest < Redmine::IntegrationTest # 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 |