]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/ChapterTest.php
ZIP Imports: Added API examples, finished testing
[bookstack] / tests / Entity / ChapterTest.php
index a057d91b5603eab598add61c85881a97caccb9df..1577cee76d8ae24c58382111caac2fc7aabc0b66 100644 (file)
@@ -31,6 +31,17 @@ class ChapterTest extends TestCase
         $resp->assertSee($chapter->description_html, false);
     }
 
+    public function test_show_view_displays_description_if_no_description_html_set()
+    {
+        $chapter = $this->entities->chapter();
+        $chapter->description_html = '';
+        $chapter->description = "My great\ndescription\n\nwith newlines";
+        $chapter->save();
+
+        $resp = $this->asEditor()->get($chapter->getUrl());
+        $resp->assertSee("<p>My great<br>\ndescription<br>\n<br>\nwith newlines</p>", false);
+    }
+
     public function test_delete()
     {
         $chapter = Chapter::query()->whereHas('pages')->first();