From 84f81b4dd3d0531d1bd4b619a755ae7160daf337 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sun, 20 Dec 2015 13:50:06 -0800 Subject: [PATCH] fulfillRequest: Behavior for "refill" request When a request is already fulfilled, fulfillRequest() should return the record that was found for the previous fulfillment. --- Supporters/t/Supporters.t | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Supporters/t/Supporters.t b/Supporters/t/Supporters.t index 2fc5a92..6c422b4 100644 --- a/Supporters/t/Supporters.t +++ b/Supporters/t/Supporters.t @@ -5,7 +5,7 @@ use strict; use warnings; -use Test::More tests => 139; +use Test::More tests => 141; use Test::Exception; use Scalar::Util qw(looks_like_number reftype); @@ -346,6 +346,16 @@ is($sp->getRequestType("does-not-exist"), undef, "fufillRequest: requestType not created when fufillRequest fails."); +my $val2; + +lives_ok { $val2 = $sp->fufillRequest( { supporterId => $drapperId, + requestType => "t-shirt-small-only", who => 'peggy', + how => "left in his office." }); } + "fufillRequest: attempt to fulfill an already-fulfill request does not die ..."; + +is_deeply($val2, $val, + "fufillRequest: ... but, rather, returns the same values from the previous fufillRequest() call."); + =item getRequest =cut