From 6d66c38c127596c97e98ba423e24820a77772e9d Mon Sep 17 00:00:00 2001 From: abijeetp Date: Sat, 15 Jul 2017 18:00:39 +0530 Subject: [PATCH] Fixes issues with the test case, now creating a user with the required profile setting. --- tests/UserProfileTest.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/UserProfileTest.php b/tests/UserProfileTest.php index ebec814c4..e0c87d992 100644 --- a/tests/UserProfileTest.php +++ b/tests/UserProfileTest.php @@ -97,10 +97,11 @@ class UserProfileTest extends BrowserKitTest public function test_books_display_is_list() { - $this->asAdmin() - ->visit('/settings/users/' . $this->user->id) - ->select('list', '#books_display') - ->press('Save') + $editor = $this->getEditor([ + 'books_display' => 'list' + ]); + + $this->actingAs($editor) ->visit('/books') ->pageNotHasElement('.gallery-item') ->pageHasElement('.entity-list-item'); @@ -108,12 +109,12 @@ class UserProfileTest extends BrowserKitTest public function test_books_display_is_grid() { - $this->asAdmin() - ->visit('/settings/users/' . $this->user->id) - ->select('grid', '#books_display') - ->press('Save') + $editor = $this->getEditor([ + 'books_display' => 'grid' + ]); + + $this->actingAs($editor) ->visit('/books') - ->pageNotHasElement('.entity-list-item') ->pageHasElement('.gallery-item'); } }