diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9f7dbb97ed1..001f1e48d63 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -443,7 +443,7 @@ module ApplicationHelper # @param [optional, String] content the content of the ROBOTS tag. # defaults to no index, follow, and no archive def robot_exclusion_tag(content = "NOINDEX,FOLLOW,NOARCHIVE") - content_tag(:meta, name: "ROBOTS", content:) + tag(:meta, name: "ROBOTS", content:) end def permitted_params diff --git a/spec/views/wiki/new.html.erb_spec.rb b/spec/views/wiki/new.html.erb_spec.rb index 21a1d611ed7..90964703a16 100644 --- a/spec/views/wiki/new.html.erb_spec.rb +++ b/spec/views/wiki/new.html.erb_spec.rb @@ -72,4 +72,9 @@ RSpec.describe "wiki/new" do render assert_select "input", name: "page[parent_id]", value: "123", type: "hidden" end + + it "renders a robots exclusion meta tag in the header tags" do + render + expect(view.content_for(:header_tags)).to include('name="ROBOTS"', 'content="NOINDEX,FOLLOW,NOARCHIVE"') + end end