Skip to content

Commit 817c48f

Browse files
pushpak1300driesvints
authored andcommitted
Added Test for standalone links
1 parent 8d20c71 commit 817c48f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/Feature/ForumTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,24 @@ public function a_logged_out_user_cannot_toggle_a_like_on_a_reply()
222222
->call('toggleLike')
223223
->assertSee("0\n");
224224
}
225+
226+
/** @test */
227+
public function user_can_see_standalone_links_in_reply()
228+
{
229+
$user = $this->createUser();
230+
$thread = factory(Thread::class)->create(['slug' => 'the-first-thread']);
231+
factory(Reply::class)->create(['body'=>'https://github.com/laravelio/laravel.io check this cool project','author_id' => $user->id(), 'replyable_id' => $thread->id()]);
232+
$this->visit("/forum/{$thread->slug}")
233+
->see('<p><a href=\"https:\/\/github.com\/laravelio\/laravel.io\" rel=\"nofollow\" target=\"_blank\">https:\/\/github.com\/laravelio\/laravel.io<\/a> check this cool project<\/p>\n');
234+
}
235+
236+
/** @test */
237+
public function user_can_see_standalone_links_in_thread()
238+
{
239+
$user = $this->createUser();
240+
$thread = factory(Thread::class)->create(['slug' => 'the-first-thread','body'=> 'https://github.com/laravelio/laravel.io check this cool project']);
241+
factory(Reply::class)->create(['author_id' => $user->id(), 'replyable_id' => $thread->id()]);
242+
$this->visit("/forum/{$thread->slug}")
243+
->see('<p><a href=\"https:\/\/github.com\/laravelio\/laravel.io\" rel=\"nofollow\" target=\"_blank\">https:\/\/github.com\/laravelio\/laravel.io<\/a> check this cool project<\/p>\n');
244+
}
225245
}

0 commit comments

Comments
 (0)