public function testDelete() { $idDelete = Type::all()->last()['id']; factory(\App\Entities\Model::class)->create(['model_type_id' => $idDelete]); $this->seeInDatabase('types', ['id' => $idDelete]); $this->visit('/type/destroy/' . $idDelete)->seePageIs('/type')->see('Este registro possui refer'); $this->seeIsNotSoftDeletedInDatabase('types', ['id' => $idDelete]); $type = Type::find($idDelete); $type->contacts()->delete(); $type->entries()->delete(); $type->models()->delete(); $type->trips()->delete(); $this->seeInDatabase('types', ['id' => $idDelete]); $this->visit('/type/destroy/' . $idDelete); $this->seeIsSoftDeletedInDatabase('types', ['id' => $idDelete]); }
public function testDeleteExecutive() { $this->get('/type/destroy/' . Type::all()->last()['id'])->assertResponseStatus(302); }