MT#7067 fix api tests

ipeshinskaya/InvoiceTemplate5
Gerhard Jungwirth 12 years ago
parent 60de7de4a7
commit 582b835db6

@ -26,7 +26,7 @@ __PACKAGE__->config(
Does => [qw(ACL CheckTrailingSlash RequireSSL)],
Method => $_,
Path => __PACKAGE__->dispatch_path,
} } @{ __PACKAGE__->allowed_methods }
} } @{ __PACKAGE__->allowed_methods },
},
action_roles => [qw(HTTPMethods)],
);
@ -36,6 +36,7 @@ sub auto :Private {
$self->set_body($c);
$self->log_request($c);
return 1;
}
sub GET : Allow {
@ -240,6 +241,7 @@ sub end : Private {
my ($self, $c) = @_;
#$self->log_response($c);
return 1;
}
# vim: set tabstop=4 expandtab:

@ -46,6 +46,7 @@ sub get_valid_put_data {
my $c = $params{c};
my $media_type = $params{media_type};
my $json = $self->get_valid_raw_put_data(%params);
return unless $json;
return unless $self->require_wellformed_json($c, $media_type, $json);
return JSON::from_json($json);
}

@ -23,6 +23,7 @@ $ua->ssl_opts(
# OPTIONS tests
{
diag("server is $uri");
# test some uri params
$req = HTTP::Request->new('OPTIONS', $uri.'/api/?foo=bar&bla');
$res = $ua->request($req);
@ -76,6 +77,14 @@ $ua->ssl_opts(
subscriberprofilesets => 1,
voicemails => 1,
voicemailrecordings => 1,
soundsets => 1,
soundfiles => 1,
soundfilerecordings => 1,
reminders => 1,
trustedsources => 1,
voicemailsettings => 1,
subscriberregistrations => 1,
calls => 1,
};
foreach my $link(@links) {
my $rex = qr!^</api/[a-z]+/>; rel="collection http://purl\.org/sipwise/ngcp-api/#rel-([a-z]+s)"$!;

Loading…
Cancel
Save