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:
parent
64855886b8
commit
0dc6f32999
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue