]> BookStack Code Mirror - bookstack/blob - tests/ActivityTrackingTest.php
Updated Spanish translation
[bookstack] / tests / ActivityTrackingTest.php
1 <?php namespace Tests;
2
3
4 class ActivityTrackingTest extends BrowserKitTest
5 {
6
7     public function test_recently_viewed_books()
8     {
9         $books = \BookStack\Book::all()->take(10);
10
11         $this->asAdmin()->visit('/books')
12             ->dontSeeInElement('#recents', $books[0]->name)
13             ->dontSeeInElement('#recents', $books[1]->name)
14             ->visit($books[0]->getUrl())
15             ->visit($books[1]->getUrl())
16             ->visit('/books')
17             ->seeInElement('#recents', $books[0]->name)
18             ->seeInElement('#recents', $books[1]->name);
19     }
20
21     public function test_popular_books()
22     {
23         $books = \BookStack\Book::all()->take(10);
24
25         $this->asAdmin()->visit('/books')
26             ->dontSeeInElement('#popular', $books[0]->name)
27             ->dontSeeInElement('#popular', $books[1]->name)
28             ->visit($books[0]->getUrl())
29             ->visit($books[1]->getUrl())
30             ->visit($books[0]->getUrl())
31             ->visit('/books')
32             ->seeInNthElement('#popular .book', 0, $books[0]->name)
33             ->seeInNthElement('#popular .book', 1, $books[1]->name);
34     }
35 }
Morty Proxy This is a proxified and sanitized view of the page, visit original site.