Tests for holdRequest() now match actual operation
The tests for holdRequest() are out of date. This corrects a few of them.
This commit is contained in:
parent
dce63bd5a8
commit
2877cd0a2a
1 changed files with 6 additions and 5 deletions
|
@ -562,19 +562,20 @@ dies_ok { $drapperTShirt0HoldId = $sp->holdRequest( { donorId => $drapperId,
|
||||||
"holdRequest: dies if who not specified";
|
"holdRequest: dies if who not specified";
|
||||||
|
|
||||||
lives_ok { $drapperTShirt0HoldId = $sp->holdRequest( { donorId => $drapperId,
|
lives_ok { $drapperTShirt0HoldId = $sp->holdRequest( { donorId => $drapperId,
|
||||||
requestType => "t-shirt-0", who => 'joe',
|
requestType => "t-shirt-0", who => 'joe', holdReleaseDate => '9999-12-31',
|
||||||
heldBecause => "in-person delivery" }); }
|
heldBecause => "in-person delivery" }); }
|
||||||
"holdRequest: succeeds for existing request...";
|
"holdRequest: succeeds for existing request...";
|
||||||
|
|
||||||
ok( (defined $drapperTShirt0HoldId and looks_like_number($drapperTShirt0HoldId) and $drapperTShirt0HoldId > 0),
|
ok( (defined $drapperTShirt0HoldId and looks_like_number($drapperTShirt0HoldId) and $drapperTShirt0HoldId > 0),
|
||||||
"holdRequest: ... and id returned on successful holdRequest() is a number");
|
"holdRequest: ... and id returned on successful holdRequest() is a number");
|
||||||
|
|
||||||
lives_ok { $val = $sp->dbh()->selectall_hashref("SELECT id, date, who, how, request_id FROM request_hold", 'id'); }
|
lives_ok { $val = $sp->dbh()->selectall_hashref("SELECT id, hold_date, release_date, who, request_id, why FROM request_hold", 'id'); }
|
||||||
"holdRequest: sql command in database for entry succeeds.";
|
"holdRequest: sql command in database for entry succeeds.";
|
||||||
is_deeply($val, { $drapperTShirt0HoldId => { id => $drapperTShirt0HoldId, date => $today,
|
is_deeply($val, { $drapperTShirt0HoldId => { id => $drapperTShirt0HoldId, hold_date => $today,
|
||||||
heldBecause => 'in-person delivery planned', who => 'joe',
|
release_date => '9999-12-31',
|
||||||
|
why => 'in-person delivery', who => 'joe',
|
||||||
request_id => $tShirt0RequestId } },
|
request_id => $tShirt0RequestId } },
|
||||||
"holdRequest: databse entry from successful return is correct");
|
"holdRequest: database entry from successful return is correct");
|
||||||
|
|
||||||
my $badHold;
|
my $badHold;
|
||||||
lives_ok { $badHold = $sp->holdRequest( { donorId => $drapperId, who => 'john',
|
lives_ok { $badHold = $sp->holdRequest( { donorId => $drapperId, who => 'john',
|
||||||
|
|
Loading…
Reference in a new issue