OSDN Git Service

change story related api endpoint to /api/v1/admin/story
[newslash/newslash.git] / src / newslash_web / t / api / story.t
index 0255d83..0f443ca 100644 (file)
@@ -71,7 +71,7 @@ EOT
                         };
 
         # preview
-        $t->post_ok('/api/v1/story' => {Accept => '*/*'} => json => $test_data)
+        $t->post_ok('/api/v1/admin/story' => {Accept => '*/*'} => json => $test_data)
           ->status_is(200)
           ->json_has('/item')
           ->json_is('/item/title' => $test_title);
@@ -79,7 +79,7 @@ EOT
 
         # create
         $test_data->{action} = 'post';
-        $t->post_ok('/api/v1/story' => {Accept => '*/*'} => json => $test_data)
+        $t->post_ok('/api/v1/admin/story' => {Accept => '*/*'} => json => $test_data)
           ->status_is(200)
           ->json_has('/id')
           ->json_is('/type' => "story");
@@ -89,7 +89,7 @@ EOT
         return if !$stoid;
 
         # get
-        $t->get_ok("/api/v1/story?stoid=$stoid")
+        $t->get_ok("/api/v1/admin/story?stoid=$stoid")
           ->status_is(200)
           ->json_has('/item')
           ->json_is('/item/stoid', $stoid)
@@ -114,14 +114,14 @@ EOT
         $test_data->{item}->{title} = $new_title;
         $test_data->{item}->{stoid} = $stoid;
 
-        $t->post_ok('/api/v1/story' => {Accept => '*/*'} => json => $test_data)
+        $t->post_ok('/api/v1/admin/story' => {Accept => '*/*'} => json => $test_data)
           ->status_is(200)
           ->json_has('/id')
           ->json_is('/type' => "story");
         #diag $t->tx->res->json->{message} if $t->tx->res->code != 200;
 
         # get updated item
-        $t->get_ok("/api/v1/story?stoid=$stoid")
+        $t->get_ok("/api/v1/admin/story?stoid=$stoid")
           ->status_is(200)
           ->json_has('/item')
           ->json_is('/item/stoid', $stoid)