Bug 22908: Add tests

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9613d9f164)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-05-14 12:21:57 -05:00 committed by Martin Renvoize
parent 2ed7ecc7ee
commit e83e2a47a3
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 8 additions and 1 deletions

View File

@ -18,7 +18,7 @@
use Modern::Perl;
use DateTime::Duration;
use Test::More tests => 103;
use Test::More tests => 104;
use Test::Warn;
use t::lib::Mocks;
@ -197,6 +197,13 @@ is( @$messages, 1, 'ModSuggestion sends an email if the status is updated' );
is( CountSuggestion('CHECKED'), 1, 'CountSuggestion returns the correct number of suggestions' );
$mod_suggestion4->{manageddate} = 'invalid date!';
ModSuggestion($mod_suggestion4);
$messages = C4::Letters::GetQueuedMessages({
borrowernumber => $borrowernumber2
});
is (scalar(@$messages), 1, 'No new letter should have been generated if the update raised an error');
is( GetSuggestionInfo(), undef, 'GetSuggestionInfo without the suggestion id returns undef' );
$suggestion = GetSuggestionInfo($my_suggestionid);
is( $suggestion->{suggestionid}, $my_suggestionid, 'GetSuggestionInfo returns the suggestion id correctly' );