1 require 'integration_helper'
3 class LoginsTest < ActionDispatch::IntegrationTest
5 Capybara.current_driver = Capybara.javascript_driver
8 test "login with api_token works after redirect" do
9 visit page_with_token('active_trustedclient')
10 assert page.has_text?('Active pipelines'), "Missing 'Active pipelines' from page"
11 assert_no_match(/\bapi_token=/, current_path)
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)