|
|
@ -259,13 +259,15 @@ sub _create_subscriber {
|
|
|
|
sub _update_subscriber {
|
|
|
|
sub _update_subscriber {
|
|
|
|
|
|
|
|
|
|
|
|
my ($subscriber,@further_opts) = @_;
|
|
|
|
my ($subscriber,@further_opts) = @_;
|
|
|
|
|
|
|
|
my $content = {
|
|
|
|
|
|
|
|
%{$subscriber},
|
|
|
|
|
|
|
|
@further_opts
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$req = HTTP::Request->new('PUT', $uri.'/api/subscribers/'.$subscriber->{id});
|
|
|
|
$req = HTTP::Request->new('PUT', $uri.'/api/subscribers/'.$subscriber->{id});
|
|
|
|
$req->header('Content-Type' => 'application/json');
|
|
|
|
$req->header('Content-Type' => 'application/json');
|
|
|
|
$req->header('Prefer' => 'return=representation');
|
|
|
|
$req->header('Prefer' => 'return=representation');
|
|
|
|
$req->content(JSON::to_json({
|
|
|
|
$req->content(JSON::to_json($content));
|
|
|
|
%$subscriber,
|
|
|
|
|
|
|
|
@further_opts,
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
$res = $ua->request($req);
|
|
|
|
$res = $ua->request($req);
|
|
|
|
is($res->code, 200, "update test subscriber");
|
|
|
|
is($res->code, 200, "update test subscriber");
|
|
|
|
$subscriber = JSON::from_json($res->decoded_content);
|
|
|
|
$subscriber = JSON::from_json($res->decoded_content);
|
|
|
|