Add tests which should fail, but don't.
[catagits/Catalyst-Action-REST.git] / t / yaml-html.t
1 use strict;
2 use warnings;
3 use Test::More tests => 4;
4 use YAML::Syck;
5 use FindBin;
6
7 use lib ( "$FindBin::Bin/lib", "$FindBin::Bin/../lib" );
8 use Test::Rest;
9
10 BEGIN {
11     use_ok 'Catalyst::Test', 'Test::Serialize';
12 }
13
14 my $has_serializer = eval "require YAML::Syck";
15 SKIP: {
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 }
32 1;