-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
how can I test a delete route? I keep getting 200 responses.
beforeEach(function () {
Post::factory(2)->create();
$this->superAdmin = User::factory()->asSuperAdmin()->create();
$this->user = User::factory()->create();
$this->post = Post::all()->first();
});
// using spatie permission package
// returns 200
it('should not be able to delete a post', function () {
$this->actingAs($this->user)
->delete("/nova-api/posts?resources[]={$this->post->id}")
->assertForbidden();
// dd($this->post) // still seeing this;
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels