]> BookStack Code Mirror - bookstack/blobdiff - tests/FavouriteTest.php
respective book and chapter structure added.
[bookstack] / tests / FavouriteTest.php
index 48048e2845d64a4fbe503e394d69502186239918..11016af14bb0a7c922e86668d6896466536c38c8 100644 (file)
@@ -56,6 +56,23 @@ class FavouriteTest extends TestCase
         ]);
     }
 
+    public function test_add_and_remove_redirect_to_entity_without_history()
+    {
+        $page = $this->entities->page();
+
+        $resp = $this->asEditor()->post('/favourites/add', [
+            'type' => $page->getMorphClass(),
+            'id'   => $page->id,
+        ]);
+        $resp->assertRedirect($page->getUrl());
+
+        $resp = $this->asEditor()->post('/favourites/remove', [
+            'type' => $page->getMorphClass(),
+            'id'   => $page->id,
+        ]);
+        $resp->assertRedirect($page->getUrl());
+    }
+
     public function test_favourite_flow_with_own_permissions()
     {
         $book = $this->entities->book();