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/xml');
13 my $has_serializer = eval "require XML::Simple";
15 skip "XML::Simple not available", 4, unless $has_serializer;
17 my $xs = XML::Simple->new('ForceArray' => 0);
19 my $monkey_template = {
20 monkey => 'likes chicken!',
22 my $mres = request($t->get(url => '/monkey_get'));
23 ok( $mres->is_success, 'GET the monkey succeeded' );
24 my $output = $xs->XMLin($mres->content);
25 is_deeply($xs->XMLin($mres->content)->{'data'}, $monkey_template, "GET returned the right data");
28 'sushi' => 'is good for monkey',
30 my $mres_post = request($t->post(url => '/monkey_put', data => $xs->XMLout($post_data)));
31 ok( $mres_post->is_success, "POST to the monkey succeeded");
32 is_deeply($mres_post->content, "is good for monkey", "POST data matches");