3 class LoginWorkflowTest < ActionDispatch::IntegrationTest
4 test "default prompt to login is JSON" do
5 post('/arvados/v1/specimens', {specimen: {}},
8 assert_includes(json_response['errors'], "Not logged in")
11 test "login prompt respects JSON Accept header" do
12 post('/arvados/v1/specimens', {specimen: {}},
13 {'HTTP_ACCEPT' => 'application/json'})
15 assert_includes(json_response['errors'], "Not logged in")
18 test "login prompt respects HTML Accept header" do
19 post('/arvados/v1/specimens', {specimen: {}},
20 {'HTTP_ACCEPT' => 'text/html'})
22 assert_match(%r{/auth/joshid$}, @response.headers['Location'],
23 "HTML login prompt did not include expected redirect")