From b35191b53f1ec3c2ce52191cdcacfded5784e940 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@biblibre.com>
Date: Mon, 29 Sep 2014 15:46:46 +0200
Subject: [PATCH] Bug 13005: suggestions.budgetid should be NULL if not filled
 - Unit tests

prove t/db_dependent/Suggestions.t
should return green
---
 t/db_dependent/Suggestions.t | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t
index e3bc26c..0cf23e5 100644
--- a/t/db_dependent/Suggestions.t
+++ b/t/db_dependent/Suggestions.t
@@ -21,7 +21,7 @@ use C4::Context;
 use C4::Members;
 use C4::Letters;
 
-use Test::More tests => 91;
+use Test::More tests => 93;
 use Test::Warn;
 
 BEGIN {
@@ -78,6 +78,7 @@ is( $suggestion->{publishercode}, $my_suggestion->{publishercode}, 'NewSuggestio
 is( $suggestion->{suggestedby}, $my_suggestion->{suggestedby}, 'NewSuggestion stores the borrower number correctly' );
 is( $suggestion->{biblionumber}, $my_suggestion->{biblionumber}, 'NewSuggestion stores the biblio number correctly' );
 is( $suggestion->{STATUS}, 'ASKED', 'NewSuggestion stores a suggestion with the status ASKED by default' );
+is( $suggestion->{budgetid}, undef, 'NewSuggestion should set budgetid to NULL if not given' );
 
 is( CountSuggestion('ASKED'), 1, 'CountSuggestion returns the correct number of suggestions' );
 
@@ -98,6 +99,8 @@ $suggestion = GetSuggestion($my_suggestionid);
 is( $suggestion->{title}, $mod_suggestion1->{title}, 'ModSuggestion modifies the title  correctly' );
 is( $suggestion->{author}, $mod_suggestion1->{author}, 'ModSuggestion modifies the author correctly' );
 is( $suggestion->{publishercode}, $mod_suggestion1->{publishercode}, 'ModSuggestion modifies the publishercode correctly' );
+is( $suggestion->{budgetid}, undef, 'ModSuggestion should set budgetid to NULL if not given' );
+
 my $messages = C4::Letters::GetQueuedMessages({
     borrowernumber => $borrowernumber,
 });
-- 
2.1.0