From 81971f78dbe2ccea2f84b9c3732fb2e4dca6f233 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 22 Jan 2025 13:08:10 +0100 Subject: [PATCH] Bug 38929: Add 2 exceptions Signed-off-by: David Nind Signed-off-by: Matt Blenkinsop --- xt/api.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xt/api.t b/xt/api.t index 47e00460db2..6faebdca9ea 100755 --- a/xt/api.t +++ b/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"); -- 2.48.1