Project

General

Profile

Feature #31353 » 0002-changed-and-added-tests.patch

Bernhard Rohloff, 2021-12-06 17:58

View differences:

test/integration/layout_test.rb
45 45
    assert_select "#admin-menu", :count => 0
46 46
  end
47 47

  
48
  def test_user_menu_not_visible_when_not_logged_in
49
    with_settings :login_required => '1' do
50
      get '/'
51
      assert_select "#user-menu", 0
52
      log_user('jsmith','jsmith')
53
      get '/'
54
      assert_select "#user-menu"
55
    end
56
  end
57

  
48 58
  def test_top_menu_and_search_not_visible_when_login_required
49 59
    with_settings :login_required => '1' do
50 60
      get '/'
51
      assert_select "#top-menu > ul", 0
61
      assert_select "#global-nav > ul", 0
52 62
      assert_select "#quick-search", 0
53 63
    end
54 64
  end
......
56 66
  def test_top_menu_and_search_visible_when_login_not_required
57 67
    with_settings :login_required => '0' do
58 68
      get '/'
59
      assert_select "#top-menu > ul"
69
      assert_select "#global-nav > ul"
60 70
      assert_select "#quick-search"
61 71
    end
62 72
  end
test/unit/lib/redmine_test.rb
39 39
  include RedmineMenuTestHelper
40 40

  
41 41
  def test_top_menu
42
    assert_number_of_items_in_menu :top_menu, 5
42
    assert_number_of_items_in_menu :top_menu, 4
43 43
    assert_menu_contains_item_named :top_menu, :home
44
    assert_menu_contains_item_named :top_menu, :my_page
45 44
    assert_menu_contains_item_named :top_menu, :projects
46 45
    assert_menu_contains_item_named :top_menu, :administration
47 46
    assert_menu_contains_item_named :top_menu, :help
48 47
  end
49 48

  
50 49
  def test_account_menu
51
    assert_number_of_items_in_menu :account_menu, 4
50
    assert_number_of_items_in_menu :account_menu, 2
52 51
    assert_menu_contains_item_named :account_menu, :login
53 52
    assert_menu_contains_item_named :account_menu, :register
54
    assert_menu_contains_item_named :account_menu, :my_account
55
    assert_menu_contains_item_named :account_menu, :logout
56 53
  end
57 54

  
55
#  def test_user_menu
56
#    assert_number_of_items_in_menu  :user_menu, 4
57
#    assert_menu_contains_item_named :user_menu, :login
58
#    assert_menu_contains_item_named :user_menu, :register
59
#    assert_menu_contains_item_named :user_menu, :my_account
60
#    assert_menu_contains_item_named :user_menu, :logout
61
#  end
62

  
58 63
  def test_application_menu
59 64
    assert_number_of_items_in_menu :application_menu, 0
60 65
  end
(15-15/15)