- $this->asAdmin()->visit($page->getUrl())
- ->dontSee('Hello, This is a test')
- ->see('Well This is a second block of content');
+ $pageContent = $this->get($page->getUrl());
+ $pageContent->assertDontSee('Hello, This is a test');
+ $pageContent->assertSee('Well This is a second block of content');
+ }
+
+ public function test_page_revision_views_viewable()
+ {
+ $this->asEditor();
+
+ $entityRepo = $this->app[EntityRepo::class];
+ $page = Page::first();
+ $entityRepo->updatePage($page, $page->book_id, ['name' => 'updated page', 'html' => '<p>new content</p>', 'summary' => 'page revision testing']);
+ $pageRevision = $page->revisions->last();
+
+ $revisionView = $this->get($page->getUrl() . '/revisions/' . $pageRevision->id);
+ $revisionView->assertStatus(200);
+ $revisionView->assertSee('new content');
+
+ $revisionView = $this->get($page->getUrl() . '/revisions/' . $pageRevision->id . '/changes');
+ $revisionView->assertStatus(200);
+ $revisionView->assertSee('new content');