X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-DBIC-API.git;a=blobdiff_plain;f=t%2Frest%2Fitem.t;h=dbc5e60b61aff38a6d29b3702916ddbd9dedef72;hp=ff9a51b11b571278c1f79993afb94ca186adc2b3;hb=68e022911bf388167a3c92aa392e77dd46578cda;hpb=0b0bf9111127c9fdad1e456169ec4cdd15b160f9 diff --git a/t/rest/item.t b/t/rest/item.t index ff9a51b..dbc5e60 100644 --- a/t/rest/item.t +++ b/t/rest/item.t @@ -1,5 +1,3 @@ -use 5.6.0; - use strict; use warnings; @@ -72,4 +70,17 @@ my $track_view_url = "$base/api/rest/track/"; ); } +{ + my $req = + GET( $artist_view_url . 'action_with_error', undef, 'Accept' => 'application/json' ); + $mech->request($req); + cmp_ok( $mech->status, '==', 404, 'action returned error 404' ); + my $response = $json->decode( $mech->content ); + is_deeply( + $response, + { success => 'false' }, + 'correct data returned' + ); +} + done_testing();