closes #6414
authorManoj <jonam33@gmail.com>
Mon, 3 Aug 2015 18:56:51 +0000 (14:56 -0400)
committerManoj <jonam33@gmail.com>
Mon, 3 Aug 2015 18:56:51 +0000 (14:56 -0400)
Merge branch '6414-anonymous-public-projects-link'

apps/workbench/app/views/layouts/body.html.erb
apps/workbench/test/controllers/projects_controller_test.rb

index 0f90c416f0c929c660dd97616dd54db32a2f4750..35c0fe33a242adf02af852d4ed49884c477cbbf7 100644 (file)
         <nav class="navbar navbar-default breadcrumbs" role="navigation">
           <ul class="nav navbar-nav navbar-left">
             <li>
-              &nbsp; Public Projects &nbsp;
+              <a href="/projects/public">Public Projects</a>
             </li>
             <% project_breadcrumbs.each do |p| %>
               <li class="nav-separator">
index 13979df68f7ebfcaf2a466b6fa2d6fb7249be47b..afcba936adae6bf1f070ea65c61f2f9091ee70a1 100644 (file)
@@ -397,4 +397,14 @@ class ProjectsControllerTest < ActionController::TestCase
       assert_includes @response.body, "All #{target}"
     end
   end
+
+  test "visit a public project and verify the public projects page link exists" do
+    Rails.configuration.anonymous_user_token = api_fixture('api_client_authorizations')['anonymous']['api_token']
+    uuid = api_fixture('groups')['anonymously_accessible_project']['uuid']
+    get :show, {id: uuid}
+    project = assigns(:object)
+    assert_equal uuid, project['uuid']
+    refute_empty css_select("[href=\"/projects/#{project['uuid']}\"]")
+    assert_includes @response.body, "<a href=\"/projects/public\">Public Projects</a>"
+  end
 end