|
|
|
@ -62,13 +62,20 @@ while (<F>) { |
|
|
|
|
close F; |
|
|
|
|
|
|
|
|
|
ok( $hstruct = from_json($hstruct), 'struct.json is JSON' ); |
|
|
|
|
ok( ref $hstruct eq 'ARRAY', 'struct.json is an array' ); |
|
|
|
|
ok( ref $hstruct eq 'ARRAY', 'struct.json is an array' ) |
|
|
|
|
or print STDERR "Expected: ARRAY, got: " . ( ref $hstruct ) . "\n"; |
|
|
|
|
count(2); |
|
|
|
|
|
|
|
|
|
foreach my $query (@hkeys) { |
|
|
|
|
my $href = &client->jsonResponse( "/confs/1/$query", '' ); |
|
|
|
|
ok( ref $href eq 'ARRAY', 'Response is an array' ); |
|
|
|
|
ok( |
|
|
|
|
( ref $href eq 'ARRAY' ) |
|
|
|
|
or |
|
|
|
|
( ( ref $href eq 'HASH' ) and ( $href->{error} =~ /setDefault$/ ) ), |
|
|
|
|
'Response is an array' |
|
|
|
|
); |
|
|
|
|
count(1); |
|
|
|
|
next if ( ( ref $href eq 'HASH' ) and ( $href->{error} =~ /setDefault$/ ) ); |
|
|
|
|
foreach my $k (@$href) { |
|
|
|
|
ok( defined $k->{title}, 'Title defined' ); |
|
|
|
|
ok( defined $k->{id}, 'Id defined' ); |
|
|
|
|