5 use lib "$FindBin::Bin/lib";
6 use Catalyst::Test 'TestApp', {default_host => 'default.com'};
8 use HTTP::Request::Common;
12 content_like('/',qr/root/,'content check');
13 action_ok('/','Action ok ok','normal action ok');
14 action_redirect('/engine/response/redirect/one','redirect check');
15 action_notfound('/engine/response/status/s404','notfound check');
17 # so we can see the default test name
20 contenttype_is('/action/local/one','text/plain','Contenttype check');
22 ### local_request() was not setting response base from base href
24 my $response = request('/base_href_test');
25 is( $response->base, 'http://www.example.com/', 'response base set from base href');
29 my $req = '/dump/request';
32 eval '$creq = ' . request($req)->content;
33 is( $creq->uri->host, 'default.com', 'request targets default host set via import' );
37 local $Catalyst::Test::default_host = 'localized.com';
38 eval '$creq = ' . request($req)->content;
39 is( $creq->uri->host, 'localized.com', 'target host is mutable via package var' );
43 my %opts = ( host => 'opthash.com' );
44 eval '$creq = ' . request($req, \%opts)->content;
45 is( $creq->uri->host, $opts{host}, 'target host is mutable via options hashref' );
49 my $response = request( POST( '/bodyparams', { override => 'this' } ) )->content;
50 is($response, 'that', 'body param overridden');
54 my $response = request( POST( '/bodyparams/no_params' ) )->content;
55 is($response, 'HASH', 'empty body param is hashref');