Commits

Felix Schäfer committed 5518ed1

Show the register link everywhere it's needed #979

Contributed by Harald Klimach

  • Participants
  • Parent commits 7272dec

Comments (0)

Files changed (2)

File app/views/layouts/base.rhtml

         <%= render :partial => 'search/quick_search', :locals => {:search_term => @question} %>
       </div>
 
-      <% if User.current.logged? || !Setting.login_required? %>
       <ul id="account-nav">
+        <% if User.current.logged? || !Setting.login_required? %>
         <% main_top_menu_items.each do |item| %>
             <%= render_menu_node(item) %>
         <% end %>
           </ul>
         </li>
         <% end %>
-          <%= render_menu_node(help_menu_item) %>
+        <%= render_menu_node(help_menu_item) %>
+        <% end %>
           <% unless User.current.logged? %>
             <% if Setting.self_registration? %>
             <li>
             </li>
           <% end %>
       </ul>
-      <% end %>
     </div>
     </div>
     <div id="breadcrumb">

File test/integration/account_test.rb

     assert_equal 0, Token.count
   end
 
+  def test_self_register_link_present
+    Setting.self_registration = '3'
+    Setting.login_required = '1'
+
+    get "/"
+    follow_redirect!
+    assert_select "a[href*=?]", "/account/register", :text => "Register"
+  end
+
   def test_register_with_automatic_activation
     Setting.self_registration = '3'