Project

General

Profile

Feature #33658 » 33658-use-robots_txt-instead-of-robots-meta-tag.patch

Go MAEDA, 2020-12-02 09:33

View differences:

app/views/account/login.html.erb
<% else %>
<%= javascript_tag "$('#username').focus();" %>
<% end %>
<% content_for :header_tags do %>
<%= robot_exclusion_tag %>
<% end %>
app/views/account/lost_password.html.erb
</p>
</div>
<% end %>
<% content_for :header_tags do %>
<%= robot_exclusion_tag %>
<% end %>
app/views/account/password_recovery.html.erb
</div>
<p><%= submit_tag l(:button_save) %></p>
<% end %>
<% content_for :header_tags do %>
<%= robot_exclusion_tag %>
<% end %>
app/views/account/register.html.erb
<%= submit_tag l(:button_submit) %>
<% end %>
<% content_for :header_tags do %>
<%= robot_exclusion_tag %>
<% end %>
app/views/welcome/robots.text.erb
Disallow: <%= url_for(issues_path) %>?*set_filter=
Disallow: <%= url_for(issues_path(:trailing_slash => true)) %>*.pdf$
Disallow: <%= url_for(projects_path(:trailing_slash => true)) %>*.pdf$
Disallow: <%= url_for(signin_path) %>
Disallow: <%= url_for(register_path) %>
Disallow: <%= url_for(lost_password_path) %>
test/functional/account_controller_test.rb
assert_select 'input[name=username]'
assert_select 'input[name=password]'
assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
end
def test_get_login_while_logged_in_should_redirect_to_back_url_if_present
......
assert_select 'input[name=?]', 'user[password]'
assert_select 'input[name=?]', 'user[password_confirmation]'
assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
end
end
......
get :lost_password
assert_response :success
assert_select 'input[name=mail]'
assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
end
def test_lost_password_for_active_user_should_create_a_token
......
assert_response :success
assert_select 'input[type=hidden][name=token][value=?]', token.value
assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
end
def test_get_lost_password_with_invalid_token_should_redirect
test/integration/welcome_test.rb
assert @response.body.match(%r{^Disallow: /issues\?\*set_filter=\r?$})
assert @response.body.match(%r{^Disallow: /issues/\*\.pdf\$\r?$})
assert @response.body.match(%r{^Disallow: /projects/\*\.pdf\$\r?$})
assert @response.body.match(%r{^Disallow: /login$})
assert @response.body.match(%r{^Disallow: /account/register$})
assert @response.body.match(%r{^Disallow: /account/lost_password$})
end
end
(3-3/3)