solve unit tests

This commit is contained in:
harshjagad20
2021-12-01 13:25:24 +05:30
parent f57fa41640
commit 88bfb38b56
33 changed files with 205 additions and 219 deletions

View File

@ -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 () {