1
0
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:
Dan Brown
2021-06-22 21:32:55 +01:00
parent 57ea2e92ec
commit 992f03a3c0
9 changed files with 85 additions and 3 deletions

View File

@ -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"');
}
}