X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/60030a774d8641a1eabc5ce44274bc3b1f8eb25e..refs/pull/5280/head:/tests/Commands/ClearViewsCommandTest.php diff --git a/tests/Commands/ClearViewsCommandTest.php b/tests/Commands/ClearViewsCommandTest.php index d553ead2e..c9179089b 100644 --- a/tests/Commands/ClearViewsCommandTest.php +++ b/tests/Commands/ClearViewsCommandTest.php @@ -1,11 +1,13 @@ -asEditor(); @@ -14,16 +16,18 @@ class ClearViewsCommandTest extends TestCase $this->get($page->getUrl()); $this->assertDatabaseHas('views', [ - 'user_id' => $this->getEditor()->id, + 'user_id' => $this->users->editor()->id, 'viewable_id' => $page->id, - 'views' => 1 + 'views' => 1, ]); + DB::rollBack(); $exitCode = \Artisan::call('bookstack:clear-views'); + DB::beginTransaction(); $this->assertTrue($exitCode === 0, 'Command executed successfully'); $this->assertDatabaseMissing('views', [ - 'user_id' => $this->getEditor()->id + 'user_id' => $this->users->editor()->id, ]); } -} \ No newline at end of file +}