Merge branch 'master' into 3642-search-for-active-only
authorradhika <radhika@curoverse.com>
Tue, 26 Aug 2014 18:04:48 +0000 (14:04 -0400)
committerradhika <radhika@curoverse.com>
Tue, 26 Aug 2014 18:04:48 +0000 (14:04 -0400)
apps/workbench/app/views/layouts/body.html.erb
apps/workbench/test/integration/search_box_test.rb

index 3f95be35de925582c7de0b33083baf3bae44db42..8645e599ddd2d44aae01e983d342fc4b714f8981 100644 (file)
@@ -18,6 +18,7 @@
           </li>
 
           <% if current_user %>
+          <% if current_user.is_active %>
           <li>
             <form class="navbar-form" role="search"
                        data-search-modal=
@@ -36,6 +37,7 @@
               </div>
             </form>
           </li>
+          <% end %>
 
           <li class="dropdown notification-menu">
             <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="notifications-menu">
index 0cdfdc8aab3df48a5f61633f5e38ce9dbe801bf8..dbb51317a9582bcfba9f87726f62f0514a1931fa 100644 (file)
@@ -14,6 +14,7 @@ class SearchBoxTest < ActionDispatch::IntegrationTest
     if user && user['is_active']
       # let's search for a valid uuid
       within('.navbar-fixed-top') do
+        page.has_field?('search')
         page.find_field('search').set user['uuid']
         page.find('.glyphicon-search').click
       end
@@ -76,10 +77,17 @@ class SearchBoxTest < ActionDispatch::IntegrationTest
       # seeing "Unrestricted public data" now
       assert page.has_text?(publicly_accessible_project['name']), 'No text - publicly accessible project name'
       assert page.has_text?(publicly_accessible_project['description']), 'No text - publicly accessible project description'
+    else
+      within('.navbar-fixed-top') do
+        page.has_no_field?('search')
+      end
     end
   end
 
   [
+    [nil, nil],
+    ['inactive', api_fixture('users')['inactive']],
+    ['inactive_uninvited', api_fixture('users')['inactive_uninvited']],
     ['active', api_fixture('users')['active']],
     ['admin', api_fixture('users')['admin']],
   ].each do |token, user|