]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/BookShelfTest.php
ZIP Imports: Added API examples, finished testing
[bookstack] / tests / Entity / BookShelfTest.php
index 7f6542d5c710d4f4abfc5d61666fcfcf0edabeaa..fb9862931ae4c211cdc9a184fa533d2f41a00dc5 100644 (file)
@@ -403,4 +403,15 @@ class BookShelfTest extends TestCase
         $resp = $this->asEditor()->get($shelf->getUrl('/create-book'));
         $this->withHtml($resp)->assertElementContains('form a[href="' . $shelf->getUrl() . '"]', 'Cancel');
     }
+
+    public function test_show_view_displays_description_if_no_description_html_set()
+    {
+        $shelf = $this->entities->shelf();
+        $shelf->description_html = '';
+        $shelf->description = "My great\ndescription\n\nwith newlines";
+        $shelf->save();
+
+        $resp = $this->asEditor()->get($shelf->getUrl());
+        $resp->assertSee("<p>My great<br>\ndescription<br>\n<br>\nwith newlines</p>", false);
+    }
 }