-<?php
+<?php namespace Tests;
-class UserProfileTest extends TestCase
+class UserProfileTest extends BrowserKitTest
{
protected $user;
$newUser = $this->getEditor();
$this->actingAs($newUser);
$entities = $this->createEntityChainBelongingToUser($newUser, $newUser);
- Activity::add($entities['book'], 'book_update', $entities['book']->id);
- Activity::add($entities['page'], 'page_create', $entities['book']->id);
+ \Activity::add($entities['book'], 'book_update', $entities['book']->id);
+ \Activity::add($entities['page'], 'page_create', $entities['book']->id);
$this->asAdmin()->visit('/user/' . $newUser->id)
->seeInElement('#recent-activity', 'updated book')
$newUser = $this->getEditor();
$this->actingAs($newUser);
$entities = $this->createEntityChainBelongingToUser($newUser, $newUser);
- Activity::add($entities['book'], 'book_update', $entities['book']->id);
- Activity::add($entities['page'], 'page_create', $entities['book']->id);
+ \Activity::add($entities['book'], 'book_update', $entities['book']->id);
+ \Activity::add($entities['page'], 'page_create', $entities['book']->id);
$this->asAdmin()->visit('/')->clickInElement('#recent-activity', $newUser->name)
->seePageIs('/user/' . $newUser->id)
->seePageIs('/settings/users/' . $guestUser->id)
->see('cannot delete the guest user');
}
-
+
+ public function test_books_view_is_list()
+ {
+ $editor = $this->getEditor([
+ 'books_view_type' => 'list'
+ ]);
+
+ $this->actingAs($editor)
+ ->visit('/books')
+ ->pageNotHasElement('.featured-image-container')
+ ->pageHasElement('.entity-list-item');
+ }
+
+ public function test_books_view_is_grid()
+ {
+ $editor = $this->getEditor([
+ 'books_view_type' => 'grid'
+ ]);
+
+ $this->actingAs($editor)
+ ->visit('/books')
+ ->pageHasElement('.featured-image-container');
+ }
}