From bb2247fd338e04b71a1dac2c05516a4f0d361b52 Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Mon, 5 Oct 2015 07:44:16 -0400
Subject: [PATCH] Bug 5144 [QA Followup] - Add unit test

---
 t/db_dependent/Reserves.t |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t
index ea47f09..ec0876f 100755
--- a/t/db_dependent/Reserves.t
+++ b/t/db_dependent/Reserves.t
@@ -17,7 +17,7 @@
 
 use Modern::Perl;
 
-use Test::More tests => 71;
+use Test::More tests => 72;
 
 use MARC::Record;
 use DateTime::Duration;
@@ -443,6 +443,12 @@ $p = C4::Reserves::CalculatePriority($bibnum, $resdate);
 is($p, 3, 'CalculatePriority should now return priority 3');
 # End of tests for bug 8918
 
+# Test for bug 5144
+my $reserve_id = AddReserve('CPL',  $requesters{'CPL3'}, $bibnum,
+           $bibitems,  $p, output_pref($resdate), $expdate, $notes,
+           $title,      $checkitem, $found);
+is( $reserve_id, undef, 'Attempt to add a second reserve on a given record for the same patron fails.' );
+
 # Tests for cancel reserves by users from OPAC.
 $dbh->do('DELETE FROM reserves', undef, ($bibnum));
 AddReserve('CPL',  $requesters{'CPL'}, $item_bibnum,
-- 
1.7.2.5