7 use lib ( "$FindBin::Bin/lib", "$FindBin::Bin/../lib" );
11 use_ok 'Catalyst::Test', 'Test::Serialize';
14 my $has_serializer = eval "require YAML::Syck";
16 skip "YAML::Syck not available", 3, unless $has_serializer;
18 my $t = Test::Rest->new( 'content_type' => 'text/html' );
21 "<html><title>Test::Serialize</title><body><pre>--- \nmonkey: likes chicken!\n</pre></body></html>";
22 my $mres = request( $t->get( url => '/monkey_get' ) );
23 ok( $mres->is_success, 'GET the monkey succeeded' );
24 is( $mres->content, $monkey_template, "GET returned the right data" );
26 my $post_data = { 'sushi' => 'is good for monkey', };
28 request( $t->post( url => '/monkey_put', data => Dump($post_data) ) );
29 ok( $mres_post->is_error, "POST to the monkey failed; no deserializer." );
33 "<html><title>Test::Serialize</title><body><pre>--- \nmonkey: likes chicken > sushi!\n</pre></body></html>";
34 my $xres = request( $t->get( url => '/xss_get' ) );
35 ok( $xres->is_success, 'GET the xss succeeded' );
36 is( $xres->content, $xss_template, "GET returned the right data" );