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
17 visit page_with_token('expired_trustedclient')
18 # Even the error page has a "Log in" link. We should look for
19 # something that only appears the real login page.
20 assert page.has_text? 'Please log in'