addRequest: Two additional tests.
This commit is contained in:
parent
cb01c1a14c
commit
075d7998d8
1 changed files with 13 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Test::More tests => 127;
|
use Test::More tests => 129;
|
||||||
use Test::Exception;
|
use Test::Exception;
|
||||||
|
|
||||||
use Scalar::Util qw(looks_like_number reftype);
|
use Scalar::Util qw(looks_like_number reftype);
|
||||||
|
@ -268,17 +268,27 @@ my $joinEmailListRequestId = $sp->getRequestType("join-announce-email-list");
|
||||||
ok((defined $joinEmailListRequestId and looks_like_number($joinEmailListRequestId) and $joinEmailListRequestId > 0),
|
ok((defined $joinEmailListRequestId and looks_like_number($joinEmailListRequestId) and $joinEmailListRequestId > 0),
|
||||||
"addRequest: underlying call to addRequestType works properly, per getRequestType");
|
"addRequest: underlying call to addRequestType works properly, per getRequestType");
|
||||||
|
|
||||||
lives_ok { $emailListRequestId =
|
my $tshirtSmallRequestId;
|
||||||
|
|
||||||
|
lives_ok { $tshirtSmallRequestId =
|
||||||
$sp->addRequest({ supporterId => $drapperId, requestType => "t-shirt-small-only",
|
$sp->addRequest({ supporterId => $drapperId, requestType => "t-shirt-small-only",
|
||||||
requestConfiguration => 'Small',
|
requestConfiguration => 'Small',
|
||||||
note => 'he probably needs a larger size but this shirt has none'}); }
|
note => 'he probably needs a larger size but this shirt has none'}); }
|
||||||
"addRequest: succeeds with a requestType and requestConfiguration and a note.";
|
"addRequest: succeeds with a requestType and requestConfiguration and a note.";
|
||||||
|
|
||||||
lives_ok { $emailListRequestId =
|
ok( (defined $tshirtSmallRequestId and looks_like_number($tshirtSmallRequestId) and $tshirtSmallRequestId > 0),
|
||||||
|
"addRequest: successful call returns an integer id.");
|
||||||
|
|
||||||
|
my $tShirt0RequestId;
|
||||||
|
lives_ok { $tShirt0RequestId =
|
||||||
$sp->addRequest({ supporterId => $drapperId, requestTypeId => $tShirt0RequestTypeId,
|
$sp->addRequest({ supporterId => $drapperId, requestTypeId => $tShirt0RequestTypeId,
|
||||||
requestConfigurationId => $tShirt0Data->{$tShirt0RequestTypeId}{'MenL'} }); }
|
requestConfigurationId => $tShirt0Data->{$tShirt0RequestTypeId}{'MenL'} }); }
|
||||||
"addRequest: succeeds with a requestTypeId and requestConfigurationId with no a note.";
|
"addRequest: succeeds with a requestTypeId and requestConfigurationId with no a note.";
|
||||||
|
|
||||||
|
ok( (defined $tShirt0RequestId and looks_like_number($tShirt0RequestId) and $tShirt0RequestId > 0),
|
||||||
|
"addRequest: another successful call returns an integer id.");
|
||||||
|
|
||||||
|
|
||||||
=item fufillRequest
|
=item fufillRequest
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
Loading…
Reference in a new issue