setUpForm(); }); it('cancels a participant', function () { $this->login()->loginNami()->withoutExceptionHandling(); $form = Form::factory() ->has(Participant::factory()) ->sections([]) ->create(); $this->deleteJson(route('participant.destroy', ['participant' => $form->participants->first()])) ->assertOk(); $this->assertDatabaseCount('participants', 1); $this->assertDatabaseHas('participants', [ 'cancelled_at' => now(), 'id' => $form->participants->first()->id, ]); }); it('testItCanDestroyAParticipant', function () { $this->login()->loginNami()->withoutExceptionHandling(); $form = Form::factory() ->has(Participant::factory()) ->sections([]) ->create(); $this->deleteJson(route('participant.destroy', ['participant' => $form->participants->first()]), [], ['X-Force' => '1']) ->assertOk(); $this->assertDatabaseCount('participants', 0); });