4 use RT::Test tests => 9;
6 RT->Config->Set( DevelMode => 0 );
7 RT->Config->Set( WebRemoteUserAuth => 1 );
9 my ( $url, $m ) = RT::Test->started_ok( basic_auth => 1 );
11 # This tests the plack middleware, not RT
13 is($m->status, 401, "Initial request with no creds gets 401");
15 # This tests the plack middleware, not RT
16 $m->get($url, $m->auth_header( root => "wrong" ));
17 is($m->status, 401, "Request with wrong creds gets 401");
19 $m->get($url, $m->auth_header( root => "password" ));
20 is($m->status, 200, "Request with right creds gets 200");
23 qr{<span class="current-user">\Qroot\E</span>}i,
24 "Has user on the page"
26 $m->content_unlike(qr/Logout/i, "Has no logout button, no WebFallbackToRTLogin");
28 # Again, testing the plack middleware
30 is($m->status, 401, "Subsequent requests without credentials aren't still logged in");
33 # Put the credentials back for the warnings check at the end
34 $m->auth( root => "password" );