]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/PageDraftTest.php
Decode HTML entities
[bookstack] / tests / Entity / PageDraftTest.php
index e83f78a10a8a8f2d566ece9586a115dd24d4c323..a0cf9e5fca9267aa6a8866f00f9e940e87b27ece 100644 (file)
@@ -1,6 +1,8 @@
-<?php namespace Tests;
+<?php namespace Tests\Entity;
 
+use BookStack\Entities\Page;
 use BookStack\Entities\Repos\PageRepo;
+use Tests\BrowserKitTest;
 
 class PageDraftTest extends BrowserKitTest
 {
@@ -100,4 +102,15 @@ class PageDraftTest extends BrowserKitTest
             ->dontSeeInElement('.book-contents', 'New Page');
     }
 
+    public function test_page_html_in_ajax_fetch_response()
+    {
+        $this->asAdmin();
+        $page = Page::query()->first();
+
+        $this->getJson('/ajax/page/' . $page->id);
+        $this->seeJson([
+            'html' => $page->html,
+        ]);
+    }
+
 }