Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / test / integration / logins_test.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require 'integration_helper'
6
7 class LoginsTest < ActionDispatch::IntegrationTest
8   setup do
9     need_javascript
10   end
11
12   test "login with api_token works after redirect" do
13     visit page_with_token('active_trustedclient')
14     assert page.has_text?('Recent processes'), "Missing 'Recent processes' from page"
15     assert_no_match(/\bapi_token=/, current_path)
16   end
17
18   test "trying to use expired token redirects to login page" do
19     visit page_with_token('expired_trustedclient')
20     buttons = all("button.btn", text: /Log in/)
21     assert_equal(1, buttons.size, "Failed to find one login button")
22   end
23 end