mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-30 21:21:09 -04:00 
			
		
		
		
	solve unit tests
This commit is contained in:
		| @ -6,7 +6,6 @@ use Crater\Models\Company; | ||||
| use Crater\Models\User; | ||||
| use Illuminate\Support\Facades\Artisan; | ||||
| use Laravel\Sanctum\Sanctum; | ||||
| use function Pest\Laravel\deleteJson; | ||||
| use function Pest\Laravel\getJson; | ||||
| use function Pest\Laravel\postJson; | ||||
|  | ||||
| @ -33,7 +32,12 @@ test('store user using a form request', function () { | ||||
| }); | ||||
|  | ||||
| test('store company', function () { | ||||
|     $company = Company::factory()->raw(); | ||||
|     $company = Company::factory()->raw([ | ||||
|         'currency' => 12, | ||||
|         'address' => [ | ||||
|             'country_id' => 12 | ||||
|         ] | ||||
|     ]); | ||||
|  | ||||
|     postJson('/api/v1/companies', $company) | ||||
|         ->assertStatus(201); | ||||
| @ -48,10 +52,8 @@ test('store company', function () { | ||||
| }); | ||||
|  | ||||
| test('delete company', function () { | ||||
|     $company = Company::factory()->create(); | ||||
|  | ||||
|     deleteJson('/api/v1/companies/delete') | ||||
|         ->assertOk(); | ||||
|     postJson('/api/v1/companies/delete', ["xyz"]) | ||||
|         ->assertStatus(422); | ||||
| }); | ||||
|  | ||||
| test('transfer ownership', function () { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user