]>
BookStack Code Mirror - bookstack/blobdiff - tests/Api/ApiDocsTest.php
projects
/
bookstack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Comments: Added HTML filter on load, tinymce elem filtering
[bookstack]
/
tests
/
Api
/
ApiDocsTest.php
diff --git
a/tests/Api/ApiDocsTest.php
b/tests/Api/ApiDocsTest.php
index 3cbcadfa30759d4197bbc8775370b0b954760590..a1603e0ef8274d244835c75e12a076045cb31ad5 100644
(file)
--- a/
tests/Api/ApiDocsTest.php
+++ b/
tests/Api/ApiDocsTest.php
@@
-1,4
+1,6
@@
-<?php namespace Tests\Api;
+<?php
+
+namespace Tests\Api;
use Tests\TestCase;
use Tests\TestCase;
@@
-6,16
+8,12
@@
class ApiDocsTest extends TestCase
{
use TestsApi;
{
use TestsApi;
- protected $endpoint = '/api/docs';
+ protected
string
$endpoint = '/api/docs';
- public function test_
docs_page_not_visible_to_normal_viewer
s()
+ public function test_
api_endpoint_redirects_to_doc
s()
{
{
- $viewer = $this->getViewer();
- $resp = $this->actingAs($viewer)->get($this->endpoint);
- $resp->assertStatus(403);
-
- $resp = $this->actingAsApiEditor()->get($this->endpoint);
- $resp->assertStatus(200);
+ $resp = $this->actingAsApiEditor()->get('/api');
+ $resp->assertRedirect('api/docs');
}
public function test_docs_page_returns_view_with_docs_content()
}
public function test_docs_page_returns_view_with_docs_content()
@@
-33,10
+31,10
@@
class ApiDocsTest extends TestCase
$resp->assertStatus(200);
$resp->assertHeader('Content-Type', 'application/json');
$resp->assertJson([
$resp->assertStatus(200);
$resp->assertHeader('Content-Type', 'application/json');
$resp->assertJson([
- 'docs' => [
[
+ 'docs' => [[
'name' => 'docs-display',
'name' => 'docs-display',
- 'uri'
=> 'api/docs'
- ]
]
+ 'uri'
=> 'api/docs',
+ ]
],
]);
}
]);
}
-}
\ No newline at end of file
+}