Feature #29503 ยป fix-29503.diff
| app/views/wiki/show.html.erb (working copy) | ||
|---|---|---|
|
<%= render :partial => 'sidebar' %>
|
||
|
<% end %>
|
||
|
<% content_for :header_tags do %>
|
||
|
<%= robot_exclusion_tag unless @content.current_version? %>
|
||
|
<% end %>
|
||
|
<% html_title @page.pretty_title %>
|
||
| test/functional/wiki_controller_test.rb (working copy) | ||
|---|---|---|
|
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
|
||
|
# Old versions should not be indexed by search engines
|
||
|
get :show, :params => {:project_id => 'ecookbook', :id => 'CookBook_documentation', :version => '2'}
|
||
|
assert_response :success
|
||
|
assert_select 'head meta[name="robots"][content=?]', 'noindex,follow,noarchive'
|
||
|
# The current version
|
||
|
get :show, :params => {:project_id => 'ecookbook', :id => 'CookBook_documentation'}
|
||
|
assert_response :success
|
||
|
assert_select 'head meta[name="robots"]', false
|
||
|
end
|
||
|
end
|
||