X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/cc10d1ddfc652f6bcf3bbf61d5ec2e2861394c03..refs/pull/5280/head:/tests/FavouriteTest.php diff --git a/tests/FavouriteTest.php b/tests/FavouriteTest.php index 48048e284..11016af14 100644 --- a/tests/FavouriteTest.php +++ b/tests/FavouriteTest.php @@ -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();