From 82ec41cc33c3449972b3a194e600a96486f98b46 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Mon, 18 Jan 2016 21:13:21 -0800 Subject: [PATCH] Verify getRequest works after failed fulfill. getRequest() should return expected values after failed fulfillRequest() call --- Supporters/t/Supporters.t | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Supporters/t/Supporters.t b/Supporters/t/Supporters.t index 6cca9fe..b4f3042 100644 --- a/Supporters/t/Supporters.t +++ b/Supporters/t/Supporters.t @@ -537,6 +537,14 @@ dies_ok { $fulfillRequestId = $sp->fulfillRequest( { donorId => $drapperId, how => "in-person delivery" }); } "fulfillRequest: dies if who not specified"; +my $req; +lives_ok { $req = $sp->getRequest({donorId => $drapperId, requestType => "t-shirt-small-only" }); } + "getRequest: success after failed fulfillRequest attempts..."; + +is($req->{requestType}, "t-shirt-small-only", "getRequest: ... with correct type"); +is($req->{requestDate}, $today, "getRequest: ... and correct request date."); +is($req->{fulfillDate}, undef, "getRequest: ... but no fulfillDate."); + lives_ok { $fulfillRequestId = $sp->fulfillRequest( { donorId => $drapperId, requestType => "t-shirt-small-only", who => 'joe', how => "in-person delivery" }); }