Refactored the Content-Type negotiation to live in Catalyst::Request::REST.(drolsky)
[catagits/Catalyst-Action-REST.git] / t / view.t
diff --git a/t/view.t b/t/view.t
new file mode 100644 (file)
index 0000000..a5a379f
--- /dev/null
+++ b/t/view.t
@@ -0,0 +1,21 @@
+use strict;
+use warnings;
+use Test::More tests => 4;
+use FindBin;
+
+use lib ( "$FindBin::Bin/lib", "$FindBin::Bin/../lib" );
+use Test::Rest;
+
+use_ok 'Catalyst::Test', 'Test::Serialize';
+
+my $t = Test::Rest->new( 'content_type' => 'text/view' );
+
+my $monkey_template = "I am a simple view";
+my $mres = request( $t->get( url => '/monkey_get' ) );
+ok( $mres->is_success, 'GET the monkey succeeded' );
+is( $mres->content, $monkey_template, "GET returned the right data" );
+
+my $mres_post = request( $t->post( url => '/monkey_put', data => 1 ) );
+ok( $mres_post->is_success, "POST to the monkey passed." );
+
+1;