8784: Fix test for latest firefox.
[arvados.git] / apps / workbench / test / integration / logins_test.rb
1 require 'integration_helper'
2
3 class LoginsTest < ActionDispatch::IntegrationTest
4   setup do
5     need_javascript
6   end
7
8   test "login with api_token works after redirect" do
9     visit page_with_token('active_trustedclient')
10     assert page.has_text?('Recent pipelines and processes'), "Missing 'Recent pipelines and processes' from page"
11     assert_no_match(/\bapi_token=/, current_path)
12   end
13
14   test "trying to use expired token redirects to login page" do
15     visit page_with_token('expired_trustedclient')
16     buttons = all("a.btn", text: /Log in/)
17     assert_equal(1, buttons.size, "Failed to find one login button")
18     login_link = buttons.first[:href]
19     assert_match(%r{//[^/]+/login}, login_link)
20     assert_no_match(/\bapi_token=/, login_link)
21   end
22 end