Corrected some tests for _getOrCreateRequestType()
This commit is contained in:
parent
eee5a0d3d6
commit
8876808aec
1 changed files with 7 additions and 1 deletions
|
@ -388,6 +388,9 @@ ok(not ($sp->_verifyId($drapperId + 10)), "_verifyId: non-existent id is not fou
|
||||||
dies_ok { $sp->_getOrCreateRequestType({ }); }
|
dies_ok { $sp->_getOrCreateRequestType({ }); }
|
||||||
"_getOrCreateRequestType: dies on empty hash";
|
"_getOrCreateRequestType: dies on empty hash";
|
||||||
|
|
||||||
|
dies_ok { $sp->_getOrCreateRequestType({ requestTypeId => "NoStringsPlease" }); }
|
||||||
|
"_getOrCreateRequestType: dies for string request id";
|
||||||
|
|
||||||
dies_ok { $sp->_getOrCreateRequestType({ requestTypeId => 0 }); }
|
dies_ok { $sp->_getOrCreateRequestType({ requestTypeId => 0 }); }
|
||||||
"_getOrCreateRequestType: dies for non-existant requestTypeId";
|
"_getOrCreateRequestType: dies for non-existant requestTypeId";
|
||||||
|
|
||||||
|
@ -396,7 +399,7 @@ lives_ok { $sp->_getOrCreateRequestType(\%hh); }
|
||||||
"_getOrCreateRequestType: succeeds with just requestType";
|
"_getOrCreateRequestType: succeeds with just requestType";
|
||||||
|
|
||||||
my $rr;
|
my $rr;
|
||||||
lives_ok { $rr = $sp->getRequest("test-request"); }
|
lives_ok { $rr = $sp->getRequestType("test-request"); }
|
||||||
"_getOrCreateRequestType: lookup of a request works after _getOrCreateRequestType";
|
"_getOrCreateRequestType: lookup of a request works after _getOrCreateRequestType";
|
||||||
|
|
||||||
is_deeply(\%hh, { requestTypeId => $rr },
|
is_deeply(\%hh, { requestTypeId => $rr },
|
||||||
|
@ -404,6 +407,9 @@ is_deeply(\%hh, { requestTypeId => $rr },
|
||||||
|
|
||||||
%hh = ( requestTypeId => $rr, requestType => 'this-arg-matters-not' );
|
%hh = ( requestTypeId => $rr, requestType => 'this-arg-matters-not' );
|
||||||
|
|
||||||
|
lives_ok { $sp->_getOrCreateRequestType(\%hh); }
|
||||||
|
"_getOrCreateRequestType: lookup of existing requestType suceeds.";
|
||||||
|
|
||||||
is_deeply(\%hh, { requestTypeId => $rr },
|
is_deeply(\%hh, { requestTypeId => $rr },
|
||||||
"_getOrCreateRequestType: deletes requestType if both are provided.");
|
"_getOrCreateRequestType: deletes requestType if both are provided.");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue