- private function deleteComment($commentId) {
- // Route::delete('/ajax/comment/{id}', 'CommentController@destroy');
- $url = '/ajax/comment/' . $commentId;
- $this->call('DELETE', $url);
-
- $deletedComment = $this->checkResponse();
- return $deletedComment;
+ public function test_comments_converts_markdown_input_to_html()
+ {
+ $page = Page::first();
+ $this->asAdmin()->postJson("/comment/$page->id", [
+ 'text' => '# My Title',
+ ]);
+
+ $this->assertDatabaseHas('comments', [
+ 'entity_id' => $page->id,
+ 'entity_type' => $page->getMorphClass(),
+ 'text' => '# My Title',
+ 'html' => "<h1>My Title</h1>\n",
+ ]);
+
+ $pageView = $this->get($page->getUrl());
+ $pageView->assertSee('<h1>My Title</h1>');