diff options
Diffstat (limited to 't/spore-method')
-rw-r--r-- | t/spore-method/payload.t | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/t/spore-method/payload.t b/t/spore-method/payload.t index 483d9cc..369ec22 100644 --- a/t/spore-method/payload.t +++ b/t/spore-method/payload.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 4; +use Test::More tests => 6; use Test::Exception; @@ -15,6 +15,11 @@ my $api_with_payload = { path => '/user', required_payload => 1, }, + update_user => { + method => 'PATCH', + path => '/user', + required_payload => 1, + }, list_user => { method => 'GET', path => '/user', @@ -30,4 +35,7 @@ dies_ok { $obj->create_user(); }; like $@->body->{error}, qr/this method require a payload/; dies_ok { $obj->list_user( payload => {} ) }; -like $@->body->{error}, qr/payload requires a PUT or POST method/; +like $@->body->{error}, qr/payload requires a PUT, PATCH or POST method/; + +dies_ok { $obj->update_user(); }; +like $@->body->{error}, qr/this method require a payload/; |