]> BookStack Code Mirror - bookstack/blob - tests/HomepageTest.php
Merge pull request #483 from msaus/japanese_lang_update
[bookstack] / tests / HomepageTest.php
1 <?php namespace Tests;
2
3 use BookStack\JointPermission;
4 use BookStack\Page;
5 use BookStack\Repos\EntityRepo;
6
7 class HomepageTest extends TestCase
8 {
9
10     public function test_default_homepage_visible()
11     {
12         $this->asEditor();
13         $homeVisit = $this->get('/');
14         $homeVisit->assertSee('My Recently Viewed');
15         $homeVisit->assertSee('Recently Updated Pages');
16         $homeVisit->assertSee('Recent Activity');
17     }
18
19     public function test_custom_homepage() {
20         $this->asEditor();
21         $name = 'My custom homepage';
22         $content = 'This is the body content of my custom homepage.';
23         $customPage = $this->newPage(['name' => $name, 'html' => $content]);
24         $this->setSettings(['app-homepage' => $customPage->id]);
25
26         $homeVisit = $this->get('/');
27         $homeVisit->assertSee($name);
28         $homeVisit->assertSee($content);
29         $homeVisit->assertSee('My Recently Viewed');
30         $homeVisit->assertSee('Recently Updated Pages');
31         $homeVisit->assertSee('Recent Activity');
32     }
33 }