Handle "no type" in messages better - attempt to reply saying so.
[catagits/Catalyst-Engine-STOMP.git] / t / 04-message-driven-request.t
index 7d169ed..d194e7d 100644 (file)
@@ -1,13 +1,20 @@
 use strict;
 use warnings;
-use Test::More tests => 3;
+use Test::More tests => 5;
 
 use FindBin;
 use lib "$FindBin::Bin/../testapp/lib";
 
 BEGIN { use_ok 'Catalyst::Test::MessageDriven', 'StompTestApp' };
 
+# successful request - type is minimum attributes
 my $req = "---\ntype: ping\n";
 my $res = request('testcontroller', $req);
 ok($res, 'response to ping message');
 ok($res->is_success, 'successful response');
+
+# unsuccessful empty request - no type
+$req = "--- ~\n";
+$res = request('testcontroller', $req);
+ok($res, 'response to empty message');
+ok($res->is_error, 'unsuccessful response');