3 # This tests to make sure the REMOTE_USER environment variable is properly passed through by the engine.
9 use lib "$FindBin::Bin/../lib";
11 use Test::More tests => 7;
12 use Catalyst::Test 'TestApp';
14 use Catalyst::Request;
15 use HTTP::Request::Common;
21 'http://localhost/dump/request',
24 ok( my $response = request($request, { extra_env => { REMOTE_USER => 'dwc' } }), 'Request' );
25 ok( $response->is_success, 'Response Successful 2xx' );
26 is( $response->content_type, 'text/plain', 'Response Content-Type' );
27 like( $response->content, qr/'Catalyst::Request'/,
28 'Content is a serialized Catalyst::Request' );
33 eval '$creq = ' . $response->content,
34 'Unserialize Catalyst::Request'
36 or fail("Failed to deserialize $@ from " . $response->content);
39 isa_ok( $creq, 'Catalyst::Request' );
42 if ( $ENV{CATALYST_SERVER} ) {
43 skip 'Using remote server', 1;
45 is( $creq->remote_user, 'dwc', '$c->req->remote_user ok' );