Remove MX::Types
[catagits/Catalyst-Runtime.git] / t / aggregate / live_engine_request_remote_user.t
CommitLineData
8026359e 1#!perl
2
3# This tests to make sure the REMOTE_USER environment variable is properly passed through by the engine.
4
5use strict;
6use warnings;
7
8use FindBin;
9use lib "$FindBin::Bin/../lib";
10
11use Test::More tests => 7;
12use Catalyst::Test 'TestApp';
13
14use Catalyst::Request;
15use HTTP::Request::Common;
16
17{
18 my $creq;
19
8026359e 20 my $request = GET(
21 'http://localhost/dump/request',
22 );
23
49382cb8 24 ok( my $response = request($request, { extra_env => { REMOTE_USER => 'dwc' } }), 'Request' );
8026359e 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' );
29
30 {
31 no strict 'refs';
32 ok(
33 eval '$creq = ' . $response->content,
34 'Unserialize Catalyst::Request'
35 );
36 }
37
38 isa_ok( $creq, 'Catalyst::Request' );
81f25ce6 39 SKIP:
40 {
41 if ( $ENV{CATALYST_SERVER} ) {
42 skip 'Using remote server', 1;
43 }
44 is( $creq->remote_user, 'dwc', '$c->req->remote_user ok' );
45 }
8026359e 46}