6414: When viewing a public project, the text "Public Projects" now
[arvados.git] / apps / workbench / test / controllers / projects_controller_test.rb
index 13979df68f7ebfcaf2a466b6fa2d6fb7249be47b..51a4e37d4b75b9484f90027cf32e5da1c3575d85 100644 (file)
@@ -397,4 +397,13 @@ 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']
+    get :show, {id: api_fixture('groups')['anonymously_accessible_project']['uuid']}
+    project = assigns(:object)
+    refute_empty css_select("[href=\"/projects/#{project['uuid']}\"]")
+    assert_includes @response.body, "<a href=\"/projects/public\">Public Projects</a>"
+  end
+
 end