X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/36dcc9443ab7a079e6bcb6f874a19c740e5b8441..f9dd018181aec09a689211200bf663a5d21c771a:/apps/workbench/test/integration/errors_test.rb diff --git a/apps/workbench/test/integration/errors_test.rb b/apps/workbench/test/integration/errors_test.rb index 092041d512..26c8783cd6 100644 --- a/apps/workbench/test/integration/errors_test.rb +++ b/apps/workbench/test/integration/errors_test.rb @@ -1,19 +1,33 @@ require 'integration_helper' class ErrorsTest < ActionDispatch::IntegrationTest - BAD_UUID = "zzzzz-zzzzz-zzzzzzzzzzzzzzz" + BAD_UUID = "ffffffffffffffffffffffffffffffff+0" test "error page renders user navigation" do visit(page_with_token("active", "/collections/#{BAD_UUID}")) - assert(page.has_text?(@@API_AUTHS["active"]["email"]), + assert(page.has_text?(api_fixture("users")["active"]["email"]), "User information missing from error page") assert(page.has_no_text?(/log ?in/i), "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/), "Error page without login returned 500") end + + test "'object not found' page includes search link" do + visit(page_with_token("active", "/collections/#{BAD_UUID}")) + assert(all("a").any? { |a| a[:href] =~ %r{/collections/?(\?|$)} }, + "no search link found on 404 page") + end end