Bug 39397: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Tomas Cohen Arazi 2025-03-21 10:51:48 -03:00 committed by Katrin Fischer
parent e1cbc7780a
commit 419d708666
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 14 additions and 1 deletions

View File

@ -1806,7 +1806,7 @@ subtest 'put() tests' => sub {
subtest 'list() tests' => sub {
plan tests => 17;
plan tests => 20;
$schema->storage->txn_begin;
@ -1871,6 +1871,19 @@ subtest 'list() tests' => sub {
$biblio->biblioitem->set( { isbn => 'TOMAS' } )->store;
$t->get_ok( "//$userid:$password@/api/v1/biblios?q=$isbn_query" => { Accept => 'text/plain' } )->status_is(200);
my $fixed_date = dt_from_string("2017-01-01 01:00:00");
my $next_day = $fixed_date->clone->add( days => 1 );
# bug 39397
$biblio->timestamp($fixed_date)->store();
$biblio->biblioitem->timestamp($next_day)->store();
$query = encode_json( { biblio_id => $biblio->id } );
$t->get_ok( "//$userid:$password@/api/v1/biblios?q=$query" => { Accept => 'application/json' } )->status_is(200)
->json_is( '/0/timestamp' =>
output_pref( { dt => $fixed_date, dateformat => 'rfc3339' }, 'biblio table timestamp takes precedence' ) );
$schema->storage->txn_rollback;
};