diff --git a/tests/php/Http/Controllers/Api/NotificationControllerTest.php b/tests/php/Http/Controllers/Api/NotificationControllerTest.php index e111c1570..e8310f3c0 100644 --- a/tests/php/Http/Controllers/Api/NotificationControllerTest.php +++ b/tests/php/Http/Controllers/Api/NotificationControllerTest.php @@ -55,20 +55,11 @@ public function testUpdateAll() $user->notify(new InAppNotification('test', 'test')); $user->notify(new InAppNotification('test', 'test')); - $this->doTestApiRoute('PUT', '/api/v1/notifications', ['user_id' => $user->id]); - $this->assertEquals(3, $user->unreadNotifications()->count()); + $this->doTestApiRoute('PUT', '/api/v1/notifications/all'); - $this->be(UserTest::create()); - $this->put('/api/v1/notifications/', ['user_id' => $user->id]) - ->assertForbidden(); - $this->be($user); - $this->put('/api/v1/notifications/', ['user_id' => $user->id]) - ->assertStatus(200); + $this->assertEquals(3, $user->unreadNotifications()->count()); + $this->put('/api/v1/notifications/all')->assertSuccessful(); $this->assertEquals(0, $user->unreadNotifications()->count()); - - // invalid data - $this->put('/api/v1/notifications/', ['test'])->assertInvalid(); - $this->put('/api/v1/notifications/', ['user_id' => 'test'])->assertInvalid(); } }