Add tests which should fail, but don't.
[catagits/Catalyst-Action-REST.git] / t / yaml-html.t
CommitLineData
e601adda 1use strict;
2use warnings;
6646fdc2 3use Test::More tests => 4;
e601adda 4use YAML::Syck;
5use FindBin;
e601adda 6
7use lib ( "$FindBin::Bin/lib", "$FindBin::Bin/../lib" );
8use Test::Rest;
9
10BEGIN {
11 use_ok 'Catalyst::Test', 'Test::Serialize';
12}
13
14my $has_serializer = eval "require YAML::Syck";
15SKIP: {
16 skip "YAML::Syck not available", 3, unless $has_serializer;
17
18 my $t = Test::Rest->new( 'content_type' => 'text/html' );
19
20 my $monkey_template =
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" );
25
26 my $post_data = { 'sushi' => 'is good for monkey', };
27 my $mres_post =
28 request( $t->post( url => '/monkey_put', data => Dump($post_data) ) );
29 ok( $mres_post->is_error, "POST to the monkey failed; no deserializer." );
30
31}
321;