3 class HomepageTest extends TestCase
6 public function test_default_homepage_visible()
9 $homeVisit = $this->get('/');
10 $homeVisit->assertSee('My Recently Viewed');
11 $homeVisit->assertSee('Recently Updated Pages');
12 $homeVisit->assertSee('Recent Activity');
15 public function test_custom_homepage()
18 $name = 'My custom homepage';
19 $content = 'This is the body content of my custom homepage.';
20 $customPage = $this->newPage(['name' => $name, 'html' => $content]);
21 $this->setSettings(['app-homepage' => $customPage->id]);
23 $homeVisit = $this->get('/');
24 $homeVisit->assertSee($name);
25 $homeVisit->assertSee($content);
26 $homeVisit->assertSee('My Recently Viewed');
27 $homeVisit->assertSee('Recently Updated Pages');
28 $homeVisit->assertSee('Recent Activity');
31 public function test_delete_custom_homepage()
34 $name = 'My custom homepage';
35 $content = 'This is the body content of my custom homepage.';
36 $customPage = $this->newPage(['name' => $name, 'html' => $content]);
37 $this->setSettings(['app-homepage' => $customPage->id]);
39 $homeVisit = $this->get('/');
40 $homeVisit->assertSee($name);
42 $pageDeleteReq = $this->delete($customPage->getUrl());
43 $pageDeleteReq->assertStatus(302);
44 $pageDeleteReq->assertRedirect($customPage->getUrl());
45 $pageDeleteReq->assertSessionHas('error');
46 $pageDeleteReq->assertSessionMissing('success');
48 $homeVisit = $this->get('/');
49 $homeVisit->assertSee($name);
50 $homeVisit->assertStatus(200);