X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcatalyst-controller-rest.t;fp=t%2Fcatalyst-controller-rest.t;h=e37dab895dfc76fe7d1be7b0ba38afba924bf91d;hb=259c53c7c52a591187ae5d70e10d2ffc241a48f6;hp=5962bd67a84ddc96d210aee809b17a7309e131b0;hpb=c288a3062784dfb2291d3eac2853845a7251d040;p=catagits%2FCatalyst-Action-Serialize-Data-Serializer.git diff --git a/t/catalyst-controller-rest.t b/t/catalyst-controller-rest.t index 5962bd6..e37dab8 100644 --- a/t/catalyst-controller-rest.t +++ b/t/catalyst-controller-rest.t @@ -23,9 +23,11 @@ is_deeply( ok my $res = request( $t->get( url => '/rest/test_status_created' ) ); is $res->code, 201, "... status created"; +is $res->header('Location'), '/rest', "...location of what was created"; ok $res = request( $t->get( url => '/rest/test_status_accepted' ) ); is $res->code, 202, "... status accepted"; +is $res->header('Location'), '/rest', "...location of what was accepted"; ok $res = request( $t->get( url => '/rest/test_status_no_content' ) ); is $res->code, 204, "... status no content"; @@ -36,6 +38,7 @@ is $res->code, 302, '... status found'; is_deeply Load( $res->content ), { status => 'found' }, "... status found message"; +is $res->header('Location'), '/rest', "...location of what was found"; ok $res = request( $t->get( url => '/rest/test_status_bad_request' ) ); is $res->code, 400, '... status bad request'; @@ -66,6 +69,7 @@ is $res->code, 300, "... multiple choices"; is_deeply Load($res->content), { choices => [qw(/rest/choice1 /rest/choice2)] }, "... 300 multiple choices has response body"; +is $res->header('Location'), '/rest/choice1', "...main location of what was found"; done_testing;