r49@latte: adam | 2006-12-03 12:30:40 -0800
[catagits/Catalyst-Action-REST.git] / t / 02-json.t
similarity index 65%
rename from t/01-yaml.t
rename to t/02-json.t
index 7559615..2cbf35d 100644 (file)
@@ -8,25 +8,23 @@ use Test::Rest;
 
 use_ok 'Catalyst::Test', 'Test::Serialize';
 
-# Should use the default serializer, YAML
-my $t = Test::Rest->new('content_type' => 'text/x-yaml');
+my $t = Test::Rest->new('content_type' => 'text/x-json');
 
-my $has_serializer = eval "require YAML::Syck";
+my $has_serializer = eval "require JSON::Syck";
 SKIP: {
-    skip "YAML::Syck not available", 4, unless $has_serializer;
+    skip "JSON::Syck not available", 4, unless $has_serializer;
 
-    # We should use the default serializer, YAML
     my $monkey_template = {
         monkey => 'likes chicken!',
     };
     my $mres = request($t->get(url => '/monkey_get'));
     ok( $mres->is_success, 'GET the monkey succeeded' );
-    is_deeply(YAML::Syck::Load($mres->content), $monkey_template, "GET returned the right data");
+    is_deeply(JSON::Syck::Load($mres->content), $monkey_template, "GET returned the right data");
 
     my $post_data = {
         'sushi' => 'is good for monkey',
     };
-    my $mres_post = request($t->post(url => '/monkey_put', data => YAML::Syck::Dump($post_data)));
+    my $mres_post = request($t->post(url => '/monkey_put', data => JSON::Syck::Dump($post_data)));
     ok( $mres_post->is_success, "POST to the monkey succeeded");
     is_deeply($mres_post->content, "is good for monkey", "POST data matches");
 };