mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Added markdown export endpoints to API
- Added tests to cover. - Added slight extra spaces at content joins.
This commit is contained in:
@ -258,4 +258,15 @@ class PagesApiTest extends TestCase
|
||||
$resp->assertStatus(200);
|
||||
$resp->assertHeader('Content-Disposition', 'attachment; filename="' . $page->slug . '.pdf"');
|
||||
}
|
||||
|
||||
public function test_export_markdown_endpoint()
|
||||
{
|
||||
$this->actingAsApiEditor();
|
||||
$page = Page::visible()->first();
|
||||
|
||||
$resp = $this->get($this->baseEndpoint . "/{$page->id}/export/markdown");
|
||||
$resp->assertStatus(200);
|
||||
$resp->assertSee('# ' . $page->name);
|
||||
$resp->assertHeader('Content-Disposition', 'attachment; filename="' . $page->slug . '.md"');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user