Added /api => /api/docs redirect for convenience.
This commit is contained in:
parent
7025cb38df
commit
2051189921
2 changed files with 7 additions and 0 deletions
|
@ -42,6 +42,7 @@ Route::middleware('auth')->group(function () {
|
||||||
->where('path', '.*$');
|
->where('path', '.*$');
|
||||||
|
|
||||||
// API docs routes
|
// API docs routes
|
||||||
|
Route::redirect('/api', '/api/docs');
|
||||||
Route::get('/api/docs', [Api\ApiDocsController::class, 'display']);
|
Route::get('/api/docs', [Api\ApiDocsController::class, 'display']);
|
||||||
|
|
||||||
Route::get('/pages/recently-updated', [PageController::class, 'showRecentlyUpdated']);
|
Route::get('/pages/recently-updated', [PageController::class, 'showRecentlyUpdated']);
|
||||||
|
|
|
@ -10,6 +10,12 @@ class ApiDocsTest extends TestCase
|
||||||
|
|
||||||
protected $endpoint = '/api/docs';
|
protected $endpoint = '/api/docs';
|
||||||
|
|
||||||
|
public function test_api_endpoint_redirects_to_docs()
|
||||||
|
{
|
||||||
|
$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()
|
||||||
{
|
{
|
||||||
$resp = $this->actingAsApiEditor()->get($this->endpoint);
|
$resp = $this->actingAsApiEditor()->get($this->endpoint);
|
||||||
|
|
Loading…
Reference in a new issue