mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-06 10:44:33 +08:00
Fixed error thrown when owner existed but the creator did not
Added test to cover. For #2687
This commit is contained in:
@ -6,6 +6,22 @@ use Tests\TestCase;
|
||||
|
||||
class PageTest extends TestCase
|
||||
{
|
||||
|
||||
public function test_page_view_when_creator_is_deleted_but_owner_exists()
|
||||
{
|
||||
$page = Page::query()->first();
|
||||
$user = $this->getViewer();
|
||||
$owner = $this->getEditor();
|
||||
$page->created_by = $user->id;
|
||||
$page->owned_by = $owner->id;
|
||||
$page->save();
|
||||
$user->delete();
|
||||
|
||||
$resp = $this->asAdmin()->get($page->getUrl());
|
||||
$resp->assertStatus(200);
|
||||
$resp->assertSeeText('Owned by ' . $owner->name);
|
||||
}
|
||||
|
||||
public function test_page_creation_with_markdown_content()
|
||||
{
|
||||
$this->setSettings(['app-editor' => 'markdown']);
|
||||
|
Reference in New Issue
Block a user