]> BookStack Code Mirror - bookstack/blobdiff - tests/Api/ApiDocsTest.php
Fixes padding issues of the sidebar's items
[bookstack] / tests / Api / ApiDocsTest.php
index 1687c64a17e10a7a5110166d251be7c2721afcf1..062adce5376821a8b1914b734039c107edf6fa2b 100644 (file)
@@ -1,6 +1,7 @@
-<?php namespace Tests\Api;
+<?php
+
+namespace Tests\Api;
 
-use BookStack\Auth\User;
 use Tests\TestCase;
 
 class ApiDocsTest extends TestCase
@@ -9,16 +10,6 @@ class ApiDocsTest extends TestCase
 
     protected $endpoint = '/api/docs';
 
-    public function test_docs_page_not_visible_to_normal_viewers()
-    {
-        $viewer = $this->getViewer();
-        $resp = $this->actingAs($viewer)->get($this->endpoint);
-        $resp->assertStatus(403);
-
-        $resp = $this->actingAsApiEditor()->get($this->endpoint);
-        $resp->assertStatus(200);
-    }
-
     public function test_docs_page_returns_view_with_docs_content()
     {
         $resp = $this->actingAsApiEditor()->get($this->endpoint);
@@ -34,25 +25,10 @@ class ApiDocsTest extends TestCase
         $resp->assertStatus(200);
         $resp->assertHeader('Content-Type', 'application/json');
         $resp->assertJson([
-            'docs' => [ [
+            'docs' => [[
                 'name' => 'docs-display',
-                'uri' => 'api/docs'
-            ] ]
+                'uri'  => 'api/docs',
+            ]],
         ]);
     }
-
-    public function test_docs_page_visible_by_public_user_if_given_permission()
-    {
-        $this->setSettings(['app-public' => true]);
-        $guest = User::getDefault();
-
-        $this->startSession();
-        $resp = $this->get('/api/docs');
-        $resp->assertStatus(403);
-
-        $this->giveUserPermissions($guest, ['access-api']);
-
-        $resp = $this->get('/api/docs');
-        $resp->assertStatus(200);
-    }
-}
\ No newline at end of file
+}