Skip to content
This repository has been archived by the owner on Nov 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1394 from dewrich/tweak/fixed_match_test
Browse files Browse the repository at this point in the history
fixed deliveryservice match test case
  • Loading branch information
jheitz200 committed May 9, 2016
2 parents 4a3d45a + d75ac9a commit fc4dffe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions traffic_ops/app/t/api/1.2/deliveryservice_matches.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ Test::TestHelper->load_core_data($schema);
ok $t->post_ok( '/api/1.1/user/login', json => { u => Test::TestHelper::ADMIN_USER, p => Test::TestHelper::ADMIN_USER_PASSWORD } )->status_is(200),
'Log into the admin user?';

ok $t->get_ok("/api/1.2/deliveryservices_matches.json")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )
->json_has( '/response', 'has a response' )->json_is( '/response/0/dsName', 'test-ds1' )->json_has( '/response/0/patterns', 'has a first match' )
->json_is( '/response/1/dsName', 'test-ds2' )->json_has( '/response/1/patterns', 'has a second match' ), 'Query matches';
ok $t->get_ok("/api/1.2/deliveryservice_matches.json")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )
->json_has( '/response', 'has a response' )->json_is( '/response/0/dsName', 'test_ds1' )->json_has( '/response/0/patterns', 'has a first match' )
->json_is( '/response/1/dsName', 'test_ds2' )->json_has( '/response/1/patterns', 'has a second match' ), 'Query matches';

ok $t->get_ok("/api/1.2/deliveryservices_matches.json?format=file")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )
->json_hasnt( '/response', 'should not have a response' )->json_is( '/0/dsName', 'test-ds1' )->json_has( '/0/patterns', 'has a first match' )
->json_is( '/1/dsName', 'test-ds2' )->json_has( '/1/patterns', 'has a second match' ), 'Query matches';
ok $t->get_ok("/api/1.2/deliveryservice_matches.json?format=file")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )
->json_hasnt( '/response', 'should not have a response' )->json_is( '/0/dsName', 'test_ds1' )->json_has( '/0/patterns', 'has a first match' )
->json_is( '/1/dsName', 'test_ds2' )->json_has( '/1/patterns', 'has a second match' ), 'Query matches';

ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );

Expand All @@ -56,7 +56,7 @@ ok $t->post_ok( '/api/1.1/user/login', json => { u => Test::TestHelper::PORTAL_U
'Log into the portal user?';

# Verify Permissions
ok $t->get_ok("/api/1.2/deliveryservices_matches.json")->status_is(403)->or( sub { diag $t->tx->res->content->asset->{content}; } );
ok $t->get_ok("/api/1.2/deliveryservice_matches.json")->status_is(403)->or( sub { diag $t->tx->res->content->asset->{content}; } );

ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );

Expand Down

0 comments on commit fc4dffe

Please sign in to comment.