Bug 24294: (QA follow-up) Add rollback and 008 default test

Default for 008 was not tested yet.
Only wondering if we should insert default values only when we meet an
undefined value. Or should we also add if we meet an empty string? Is the
latter not more realistic in MARC?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Marcel de Rooy 2020-02-25 13:40:52 +00:00 committed by Martin Renvoize
parent 64855886b8
commit 0dc6f32999
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,5 @@
use Modern::Perl;
use Test::More tests => 5;
use Test::More tests => 6;
use Test::MockModule;
use MARC::Record;
@ -90,3 +90,10 @@ is_deeply(
[ [ 'x', $default_x ] ],
'099$x contains the default value'
);
# Test controlfield default
$record->field('008')->update( undef );
C4::Acquisition::FillWithDefaultValues($record);
is( $record->field('008')->data, $default_x, 'Controlfield got default' );
$schema->storage->txn_rollback;