Skip to content

Commit c6bda9d

Browse files
committed
wip
1 parent 42d4145 commit c6bda9d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020
- name: Checkout code
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2222

2323
- name: Setup PHP
2424
uses: shivammathur/setup-php@v2

tests/Feature/ReplyTest.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
use App\Notifications\MentionNotification;
99
use App\Rules\InvalidMentionRule;
1010
use Illuminate\Foundation\Testing\DatabaseMigrations;
11+
use Illuminate\Foundation\Testing\RefreshDatabase;
1112
use Illuminate\Notifications\DatabaseNotification;
1213
use Illuminate\Support\Facades\Notification;
1314
use Illuminate\Support\HtmlString;
1415
use Livewire\Livewire;
1516
use Tests\TestCase;
1617

1718
uses(TestCase::class);
18-
uses(DatabaseMigrations::class);
19+
uses(RefreshDatabase::class);
1920

2021
test('users can add a reply to a thread', function () {
2122
$thread = Thread::factory()->create(['subject' => 'The first thread', 'slug' => 'the-first-thread']);
@@ -75,11 +76,11 @@
7576
});
7677

7778
test('users cannot delete a reply they do not own', function () {
78-
Reply::factory()->create();
79+
$reply = Reply::factory()->create();
7980

8081
$this->login();
8182

82-
$this->delete('/replies/1')
83+
$this->delete("/replies/{$reply->id}")
8384
->assertForbidden();
8485
});
8586

@@ -200,13 +201,13 @@
200201
'replyable_id' => $thread->id,
201202
'replyable_type' => Thread::TABLE,
202203
]);
203-
204+
204205
$notification = DatabaseNotification::first();
205206
$this->assertSame($user->id, (int) $notification->notifiable_id);
206207
$this->assertSame('users', $notification->notifiable_type);
207208
$this->assertSame('mention', $notification->data['type']);
208209
$this->assertSame('The first thread', $notification->data['replyable_subject']);
209-
});
210+
})->only();
210211

211212
test('users are not notified when mentioned in an edited reply', function () {
212213
Notification::fake();

0 commit comments

Comments
 (0)