6 use lib ( "$FindBin::Bin/lib", "$FindBin::Bin/../lib" );
9 use_ok 'Catalyst::Test', 'Test::Serialize';
11 my $t = Test::Rest->new( 'content_type' => 'text/view' );
13 my $monkey_template = "I am a simple view";
14 my $mres = request( $t->get( url => '/monkey_get' ) );
15 ok( $mres->is_success, 'GET the monkey succeeded' );
16 is( $mres->content, $monkey_template, "GET returned the right data" );
18 my $mres_post = request( $t->post( url => '/monkey_put', data => 1 ) );
19 ok( $mres_post->is_success, "POST to the monkey passed." );
21 my $t2 = Test::Rest->new( 'content_type' => 'text/explodingview' );
22 my $res = request( $t2->get( url => '/monkey_get' ) );
24 ok (! $res->is_success, 'View errors result in failure');
25 like( $res->content, qr/don't know how/, 'The error looks okay');