From e83e2a47a3fc490634be78750e5464ffef894667 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 14 May 2019 12:21:57 -0500 Subject: [PATCH] Bug 22908: Add tests Signed-off-by: Liz Rea Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens (cherry picked from commit 9613d9f1647bfceeb15b60c731f2c84796a12f87) Signed-off-by: Martin Renvoize --- t/db_dependent/Suggestions.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t index 2d2bfb565c..4b86678683 100644 --- a/t/db_dependent/Suggestions.t +++ b/t/db_dependent/Suggestions.t @@ -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' ); -- 2.39.2