Bug 18382: Add a test

This is what I am expecting but I may be wrong.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2018-03-27 14:09:54 -03:00
parent fc033fa037
commit 9b6e65d3fd

View file

@ -29,7 +29,7 @@ use Koha::Item;
use Koha::DateUtils;
use t::lib::TestBuilder;
use Test::More tests => 31;
use Test::More tests => 33;
use Test::Warn;
use_ok('Koha::Hold');
@ -92,6 +92,9 @@ $hold->suspend_hold( $dt );
$dt->truncate( to => 'day' );
is( $hold->suspend, 1, "Hold is suspended" );
is( $hold->suspend_until, "$dt", "Hold is suspended with a date, truncation takes place automatically" );
$hold->suspend_hold;
is( $hold->suspend, 1, "Hold is suspended" );
is( $hold->suspend_until, undef, "Hold is suspended without a date" );
$hold->resume();
is( $hold->suspend, 0, "Hold is not suspended" );
is( $hold->suspend_until, undef, "Hold no longer has suspend_until date" );