]> BookStack Code Mirror - bookstack/blobdiff - tests/Permissions/RolePermissionsTest.php
respective book and chapter structure added.
[bookstack] / tests / Permissions / RolePermissionsTest.php
index d15c1617c67b885276a9ac67b08bf8494439f23e..d3146bd47bd9e838384886a17aae4dced9000563 100644 (file)
@@ -49,6 +49,7 @@ class RolePermissionsTest extends TestCase
 
         $resp = $this->get('/my-account/profile')->assertOk();
         $this->withHtml($resp)->assertElementExists('input[name=email][disabled]');
+        $resp->assertSee('Unfortunately you don\'t have permission to change your email address.');
         $this->put('/my-account/profile', [
             'name'  => 'my_new_name',
             'email' => '[email protected]',
@@ -737,16 +738,12 @@ class RolePermissionsTest extends TestCase
 
     private function addComment(Page $page): TestResponse
     {
-        $comment = Comment::factory()->make();
-
-        return $this->postJson("/comment/$page->id", $comment->only('text', 'html'));
+        return $this->postJson("/comment/$page->id", ['html' => '<p>New comment content</p>']);
     }
 
     private function updateComment(Comment $comment): TestResponse
     {
-        $commentData = Comment::factory()->make();
-
-        return $this->putJson("/comment/{$comment->id}", $commentData->only('text', 'html'));
+        return $this->putJson("/comment/{$comment->id}", ['html' => '<p>Updated comment content</p>']);
     }
 
     private function deleteComment(Comment $comment): TestResponse