<%= render_menu :account_menu -%>
</div>
<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}", :id => 'loggedas') if User.current.logged? %>
- <%= render_menu :top_menu -%>
+ <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
</div>
<div id="header">
+ <% if User.current.logged? || !Setting.login_required? %>
<div id="quick-search">
<% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
<%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
<% end %>
<%= render_project_jump_box %>
</div>
+ <% end %>
<h1><%= page_header_title %></h1>
assert_response :forbidden
assert_select "#admin-menu", :count => 0
end
+
+ def test_top_menu_and_search_not_visible_when_login_required
+ with_settings :login_required => '1' do
+ get '/'
+ assert_select "#top-menu > ul", 0
+ assert_select "#quick-search", 0
+ end
+ end
+
+ def test_top_menu_and_search_visible_when_login_not_required
+ with_settings :login_required => '0' do
+ get '/'
+ assert_select "#top-menu > ul"
+ assert_select "#quick-search"
+ end
+ end
end