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
33 33
<% else %>
34 34
<%= javascript_tag "$('#username').focus();" %>
35 35
<% end %>
36

  
37
<% content_for :header_tags do %>
38
  <%= robot_exclusion_tag %>
39
<% end %>
app/views/account/lost_password.html.erb
9 9
    </p>
10 10
  </div>
11 11
<% end %>
12

  
13
<% content_for :header_tags do %>
14
  <%= robot_exclusion_tag %>
15
<% end %>
app/views/account/password_recovery.html.erb
21 21
  </div>
22 22
  <p><%= submit_tag l(:button_save) %></p>
23 23
<% end %>
24

  
25
<% content_for :header_tags do %>
26
  <%= robot_exclusion_tag %>
27
<% end %>
app/views/account/register.html.erb
39 39

  
40 40
<%= submit_tag l(:button_submit) %>
41 41
<% end %>
42

  
43
<% content_for :header_tags do %>
44
  <%= robot_exclusion_tag %>
45
<% end %>
app/views/welcome/robots.text.erb
15 15
Disallow: <%= url_for(issues_path) %>?*set_filter=
16 16
Disallow: <%= url_for(issues_path(:trailing_slash => true)) %>*.pdf$
17 17
Disallow: <%= url_for(projects_path(:trailing_slash => true)) %>*.pdf$
18
Disallow: <%= url_for(signin_path) %>
19
Disallow: <%= url_for(register_path) %>
20
Disallow: <%= url_for(lost_password_path) %>
test/functional/account_controller_test.rb
32 32

  
33 33
    assert_select 'input[name=username]'
34 34
    assert_select 'input[name=password]'
35
    assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
36 35
  end
37 36

  
38 37
  def test_get_login_while_logged_in_should_redirect_to_back_url_if_present
......
294 293

  
295 294
      assert_select 'input[name=?]', 'user[password]'
296 295
      assert_select 'input[name=?]', 'user[password_confirmation]'
297
      assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
298 296
    end
299 297
  end
300 298

  
......
407 405
    get :lost_password
408 406
    assert_response :success
409 407
    assert_select 'input[name=mail]'
410
    assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
411 408
  end
412 409

  
413 410
  def test_lost_password_for_active_user_should_create_a_token
......
527 524
    assert_response :success
528 525

  
529 526
    assert_select 'input[type=hidden][name=token][value=?]', token.value
530
    assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
531 527
  end
532 528

  
533 529
  def test_get_lost_password_with_invalid_token_should_redirect
test/integration/welcome_test.rb
33 33
    assert @response.body.match(%r{^Disallow: /issues\?\*set_filter=\r?$})
34 34
    assert @response.body.match(%r{^Disallow: /issues/\*\.pdf\$\r?$})
35 35
    assert @response.body.match(%r{^Disallow: /projects/\*\.pdf\$\r?$})
36
    assert @response.body.match(%r{^Disallow: /login$})
37
    assert @response.body.match(%r{^Disallow: /account/register$})
38
    assert @response.body.match(%r{^Disallow: /account/lost_password$})
36 39
  end
37 40
end
(3-3/3)