1 require 'integration_helper'
3 class LoginsTest < ActionDispatch::IntegrationTest
4 test "login with api_token works after redirect" do
5 visit page_with_token('active_trustedclient')
6 assert page.has_text?('Recent jobs'), "Missing 'Recent jobs' from page"
7 assert_no_match(/\bapi_token=/, current_path)
10 test "can't use expired token" do
11 visit page_with_token('expired_trustedclient')
12 assert page.has_text? 'Log in'
15 test "expired token yields login page, not error page" do
16 visit page_with_token('expired_trustedclient')
17 # Even the error page has a "Log in" link. We should look for
18 # something that only appears the real login page.
19 assert page.has_text? ' Log in Oh... fiddlesticks. Sorry, I had some trouble handling your request'