2891: Add Workbench test for expired API token.
authorBrett Smith <brett@curoverse.com>
Wed, 25 Jun 2014 18:11:10 +0000 (14:11 -0400)
committerBrett Smith <brett@curoverse.com>
Mon, 30 Jun 2014 19:08:22 +0000 (15:08 -0400)
apps/workbench/test/integration/errors_test.rb

index 12c18f4f3dbc72c5f70469965a4b90ed5c86730c..26c8783cd63a2c618e5b263c49d9a118862f2738 100644 (file)
@@ -11,6 +11,14 @@ class ErrorsTest < ActionDispatch::IntegrationTest
            "Logged in user prompted to log in on error page")
   end
 
+  test "no user navigation with expired token" do
+    visit(page_with_token("expired", "/collections/#{BAD_UUID}"))
+    assert(page.has_no_text?(api_fixture("users")["active"]["email"]),
+           "Page visited with expired token included user information")
+    assert(page.has_selector?("a", text: /log ?in/i),
+           "Login prompt missing on expired token error page")
+  end
+
   test "error page renders without login" do
     visit "/collections/download/#{BAD_UUID}/#{@@API_AUTHS['active']['api_token']}"
     assert(page.has_no_text?(/\b500\b/),