Fixed chapter description not showing in book exports

Closes #1465
This commit is contained in:
Dan Brown 2019-05-25 15:21:02 +01:00
parent 8ae35f645a
commit 35e6635379
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 15 additions and 1 deletions

View File

@ -58,7 +58,7 @@
<h1 id="{{$bookChild->getType()}}-{{$bookChild->id}}">{{ $bookChild->name }}</h1> <h1 id="{{$bookChild->getType()}}-{{$bookChild->id}}">{{ $bookChild->name }}</h1>
@if($bookChild->isA('chapter')) @if($bookChild->isA('chapter'))
<p>{{ $bookChild->description }}</p> <p>{{ $bookChild->text }}</p>
@if(count($bookChild->pages) > 0) @if(count($bookChild->pages) > 0)
@foreach($bookChild->pages as $page) @foreach($bookChild->pages as $page)

View File

@ -76,6 +76,20 @@ class ExportTest extends TestCase
$resp->assertHeader('Content-Disposition', 'attachment; filename="' . $book->slug . '.html"'); $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $book->slug . '.html"');
} }
public function test_book_html_export_shows_chapter_descriptions()
{
$chapterDesc = 'My custom test chapter description ' . str_random(12);
$chapter = Chapter::query()->first();
$chapter->description = $chapterDesc;
$chapter->save();
$book = $chapter->book;
$this->asEditor();
$resp = $this->get($book->getUrl('/export/html'));
$resp->assertSee($chapterDesc);
}
public function test_chapter_text_export() public function test_chapter_text_export()
{ {
$chapter = Chapter::first(); $chapter = Chapter::first();