diff options
author | Andreas Marienborg <andreas.marienborg@gmail.com> | 2012-02-06 16:30:01 +0100 |
---|---|---|
committer | Andreas Marienborg <andreas.marienborg@gmail.com> | 2012-02-06 16:30:01 +0100 |
commit | 1c10f35f99c10f6f2e04b8826234e2585f6d9c22 (patch) | |
tree | c6f63ca1ee9d43652cfeb94a6afcc7237a583f56 /t/spore-method | |
parent | Support PATCH method (that github uses) (diff) | |
download | net-http-spore-1c10f35f99c10f6f2e04b8826234e2585f6d9c22.tar.gz |
Fix an error string, add a crude test
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/; |