]> BookStack Code Mirror - bookstack/commitdiff
Fixes issues with the test case, now creating a user with the required profile setting.
authorabijeetp <redacted>
Sat, 15 Jul 2017 12:30:39 +0000 (18:00 +0530)
committerabijeetp <redacted>
Sat, 15 Jul 2017 12:30:39 +0000 (18:00 +0530)
tests/UserProfileTest.php

index ebec814c4e549746ca8edaeb2e0b6df69c2c8bb9..e0c87d992abdb6f6a301d55dabd69f55ab0226cb 100644 (file)
@@ -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');
     }
 }
Morty Proxy This is a proxified and sanitized view of the page, visit original site.