Bug 38929: Add 2 exceptions
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
a5f3859c5c
commit
ff0919ec19
1 changed files with 8 additions and 1 deletions
9
xt/api.t
9
xt/api.t
|
@ -175,10 +175,17 @@ subtest '400 response tests' => sub {
|
|||
subtest 'POST (201) have location header' => sub {
|
||||
my @files = `git ls-files 'Koha/REST/V1/**/*.pm'`;
|
||||
plan tests => scalar @files;
|
||||
my @exceptions = qw(
|
||||
Koha/REST/V1/Auth/Password.pm
|
||||
Koha/REST/V1/Preservation/WaitingList.pm
|
||||
);
|
||||
foreach my $file (@files) {
|
||||
chomp $file;
|
||||
my $content = read_file($file);
|
||||
if ( $content !~ /status\s*=>\s*201/s ) {
|
||||
if ( grep { $file eq $_ } @exceptions ) {
|
||||
pass("$file is skipped - exception");
|
||||
}
|
||||
elsif ( $content !~ /status\s*=>\s*201/s ) {
|
||||
pass("$file does not seem to have a POST endpoint");
|
||||
} elsif ( $content =~ /\$c->res->headers->location\(.*?\);\s*return\s+\$c->render\s*\(\s*status\s*=>\s*201,/s ) {
|
||||
pass("$file contains the location header");
|
||||
|
|
Loading…
Reference in a new issue