User-agent: *
<% @projects.each do |p| -%>
-Disallow: /projects/<%= p.to_param %>/repository
-Disallow: /projects/<%= p.to_param %>/issues
-Disallow: /projects/<%= p.to_param %>/activity
+Disallow: <%= url_for(:controller => 'repositories', :action => :show, :id => p) %>
+Disallow: <%= url_for(project_issues_path(:project_id => p)) %>
+Disallow: <%= url_for(project_activity_path(:id => p)) %>
<% end -%>
-Disallow: /issues/gantt
-Disallow: /issues/calendar
-Disallow: /activity
-Disallow: /search
+Disallow: <%= url_for(issues_gantt_path) %>
+Disallow: <%= url_for(issues_calendar_path) %>
+Disallow: <%= url_for(activity_path) %>
+Disallow: <%= url_for(search_path) %>
get '/robots.txt'
assert_response :success
assert_equal 'text/plain', @response.content_type
+ # It seems Redmine::Utils.relative_url_root does not effect on Rails 5.1.4
assert @response.body.match(%r{^Disallow: /projects/ecookbook/issues\r?$})
end
end