]> BookStack Code Mirror - bookstack/blobdiff - tests/PublicActionTest.php
reduced icon size
[bookstack] / tests / PublicActionTest.php
index 685146423d80f54b6ce2d466ce7e8fc8e30fb417..6f8590d4b7b19f8a52d76381f2438527ac0e4b32 100644 (file)
@@ -1,6 +1,6 @@
-<?php
+<?php namespace Tests;
 
-class PublicActionTest extends TestCase
+class PublicActionTest extends BrowserKitTest
 {
 
     public function test_app_not_public()
@@ -64,7 +64,7 @@ class PublicActionTest extends TestCase
         $this->visit($chapter->book->getUrl());
         $this->visit($chapter->getUrl())
             ->click('New Page')
-            ->see('Create Page')
+            ->see('New Page')
             ->seePageIs($chapter->getUrl('/create-page'));
 
         $this->submitForm('Continue', [
@@ -80,4 +80,14 @@ class PublicActionTest extends TestCase
         ]);
     }
 
+    public function test_content_not_listed_on_404_for_public_users()
+    {
+        $page = \BookStack\Page::first();
+        $this->asAdmin()->visit($page->getUrl());
+        \Auth::logout();
+        view()->share('pageTitle', '');
+        $this->forceVisit('/cats/dogs/hippos');
+        $this->dontSee($page->name);
+    }
+
 }
\ No newline at end of file