You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2017/01/05 18:44:43 UTC

[2/3] incubator-trafficcontrol git commit: adds missing crud tests for cdn api

adds missing crud tests for cdn api


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/46ed0978
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/46ed0978
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/46ed0978

Branch: refs/heads/master
Commit: 46ed09784e8b597c0276b4c5e1953c8c96e0b6dc
Parents: da27b27
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Wed Jan 4 14:52:08 2017 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Thu Jan 5 11:13:10 2017 -0700

----------------------------------------------------------------------
 traffic_ops/app/t/api/1.2/cdn.t | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/46ed0978/traffic_ops/app/t/api/1.2/cdn.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.2/cdn.t b/traffic_ops/app/t/api/1.2/cdn.t
index a357f03..b6045c6 100644
--- a/traffic_ops/app/t/api/1.2/cdn.t
+++ b/traffic_ops/app/t/api/1.2/cdn.t
@@ -38,6 +38,12 @@ Test::TestHelper->load_core_data($schema);
 ok $t->post_ok( '/login', => form => { u => Test::TestHelper::ADMIN_USER, p => Test::TestHelper::ADMIN_USER_PASSWORD } )->status_is(302)
 	->or( sub { diag $t->tx->res->content->asset->{content}; } ), 'Should login?';
 
+$t->get_ok("/api/1.2/cdns")->status_is(200)->json_is( "/response/0/id", "1" )
+    ->json_is( "/response/0/name", "cdn1" )->or( sub { diag $t->tx->res->content->asset->{content}; } );
+
+$t->get_ok("/api/1.2/cdns/1")->status_is(200)->json_is( "/response/0/id", "1" )
+    ->json_is( "/response/0/name", "cdn1" )->or( sub { diag $t->tx->res->content->asset->{content}; } );
+
 ok $t->post_ok('/api/1.2/cdns' => {Accept => 'application/json'} => json => {
         "name" => "cdn_test"
         })