X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f2756832f844d78d782ff35e46b650c5501b0c47..d3716fbfea120893e1a23915c5f9bcb7ca96c371:/apps/workbench/test/integration/logins_test.rb diff --git a/apps/workbench/test/integration/logins_test.rb b/apps/workbench/test/integration/logins_test.rb index 9daf831810..3c6ab7c743 100644 --- a/apps/workbench/test/integration/logins_test.rb +++ b/apps/workbench/test/integration/logins_test.rb @@ -1,18 +1,23 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'integration_helper' class LoginsTest < ActionDispatch::IntegrationTest + setup do + need_javascript + end + test "login with api_token works after redirect" do visit page_with_token('active_trustedclient') - assert page.has_text?('Recent jobs'), "Missing 'Recent jobs' from page" + assert page.has_text?('Recent processes'), "Missing 'Recent processes' from page" assert_no_match(/\bapi_token=/, current_path) end test "trying to use expired token redirects to login page" do visit page_with_token('expired_trustedclient') - buttons = all("a.btn", text: /Log in/) + buttons = all("button.btn", text: /Log in/) assert_equal(1, buttons.size, "Failed to find one login button") - login_link = buttons.first[:href] - assert_match(%r{//[^/]+/login}, login_link) - assert_no_match(/\bapi_token=/, login_link) end end