summaryrefslogtreecommitdiffstats
path: root/test/functional/wiki_controller_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-12-06 00:40:39 +0000
committerGo MAEDA <maeda@farend.jp>2018-12-06 00:40:39 +0000
commite6e02e5e45e989f56329b920aa277a5c387a6f90 (patch)
tree31971ea365b9c7b490e6801387dc4128f2c4c653 /test/functional/wiki_controller_test.rb
parent8a0a3bc8edacc0e265f9bb86d775da014fa767e9 (diff)
downloadredmine-e6e02e5e45e989f56329b920aa277a5c387a6f90.tar.gz
redmine-e6e02e5e45e989f56329b920aa277a5c387a6f90.zip
Discourage search engines from indexing old versions of wiki pages (#29503).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17690 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/wiki_controller_test.rb')
-rw-r--r--test/functional/wiki_controller_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
index 7f658be0b..bf81cb73e 100644
--- a/test/functional/wiki_controller_test.rb
+++ b/test/functional/wiki_controller_test.rb
@@ -1182,4 +1182,17 @@ class WikiControllerTest < Redmine::ControllerTest
attachment = Attachment.order('id DESC').first
assert_equal Wiki.find(1).find_page('CookBook_documentation'), attachment.container
end
+
+ def test_old_version_should_have_robot_exclusion_tag
+ @request.session[:user_id] = 2
+ # Discourage search engines from indexing old versions
+ get :show, :params => {:project_id => 'ecookbook', :id => 'CookBook_documentation', :version => '2'}
+ assert_response :success
+ assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
+
+ # No robots meta tag in the current page
+ get :show, :params => {:project_id => 'ecookbook', :id => 'CookBook_documentation'}
+ assert_response :success
+ assert_select 'head>meta[name="robots"]', false
+ end
end