MT#16323 Fix api-rest/api-calllists.t: skip checking field rating_status if no CDRs exist

Otherwise we are getting error:
> not ok 10 - Check existence of rating_status field
>
> #   Failed test 'Check existence of rating_status field'
> #   at t/api-rest/api-calllists.t line 50.
> # Total number of calls: 0

Change-Id: I257e198b740363d5d25d6d35a29a482f966377fb
changes/24/3424/4
Alexander Lutay 10 years ago
parent 64ee5ec1dd
commit 1faa2cde90

@ -47,8 +47,12 @@ SKIP:
ok( ($cl_collection_ok->{total_count} + $cl_collection_nok->{total_count} ) == $cl_collection->{total_count},
"Rated and not rated calls should be equal to total number of calls");
my($call_hal) = $test_machine->get_hal_from_collection($cl_collection);
ok(exists $call_hal->{rating_status},
"Check existence of rating_status field");
if ( $cl_collection->{total_count} < 1 ) {
ok(1, "Skip checking existence of rating_status field");
} else {
ok(exists $call_hal->{rating_status}, "Check existence of rating_status field");
}
#/---

Loading…
Cancel
Save