Skip to content

Commit 8eecb7f

Browse files
committed
Improve tests
1 parent 0fc8db7 commit 8eecb7f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/Feature/SubscriptionTest.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Tests\BrowserKitTestCase;
1111
use App\Notifications\NewReply;
1212
use Illuminate\Support\Facades\Notification;
13-
use App\Jobs\UnsubscribeFromSubscriptionAble;
1413
use Illuminate\Foundation\Testing\DatabaseMigrations;
1514

1615
class SubscriptionTest extends BrowserKitTestCase
@@ -29,6 +28,7 @@ public function users_receive_notifications_for_new_replies_to_threads_where_the
2928

3029
$this->dispatch(new CreateReply($this->faker->text, $this->faker->ipv4, $author, $thread));
3130

31+
Notification::assertNotSentTo($author, NewReply::class);
3232
Notification::assertSentTo([$userOne, $userTwo], NewReply::class);
3333
}
3434

@@ -44,6 +44,18 @@ public function users_are_automatically_subscribed_to_a_thread_after_creating_it
4444
$this->assertTrue($thread->hasSubscriber($user));
4545
}
4646

47+
/** @test */
48+
public function thread_authors_do_not_receive_a_notification_for_a_thread_they_create()
49+
{
50+
Notification::fake();
51+
52+
$author = $this->createUser();
53+
54+
$this->dispatch(new CreateThread($this->faker->sentence, $this->faker->text, $this->faker->ipv4, $author));
55+
56+
Notification::assertNotSentTo($author, NewReply::class);
57+
}
58+
4759
/** @test */
4860
public function users_are_automatically_subscribed_to_a_thread_after_replying_to_it()
4961
{

0 commit comments

Comments
 (0)