Add failing tests
This commit is contained in:
parent
e0e08f284e
commit
c095f330e1
2 changed files with 6 additions and 1 deletions
|
@ -33,12 +33,14 @@ class CreateCompaniesTest extends TestCase implements TestsPermissionsRequiremen
|
||||||
$this->actingAsForApi(User::factory()->createCompanies()->create())
|
$this->actingAsForApi(User::factory()->createCompanies()->create())
|
||||||
->postJson(route('api.companies.store'), [
|
->postJson(route('api.companies.store'), [
|
||||||
'name' => 'My Cool Company',
|
'name' => 'My Cool Company',
|
||||||
|
'notes' => 'A Cool Note',
|
||||||
])
|
])
|
||||||
->assertStatus(200)
|
->assertStatus(200)
|
||||||
->assertStatusMessageIs('success');
|
->assertStatusMessageIs('success');
|
||||||
|
|
||||||
$this->assertDatabaseHas('companies', [
|
$this->assertDatabaseHas('companies', [
|
||||||
'name' => 'My Cool Company',
|
'name' => 'My Cool Company',
|
||||||
|
'notes' => 'A Cool Note',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,10 +41,13 @@ class UpdateCompaniesTest extends TestCase
|
||||||
$this->actingAsForApi(User::factory()->editCompanies()->create())
|
$this->actingAsForApi(User::factory()->editCompanies()->create())
|
||||||
->patchJson(route('api.companies.update', ['company' => $company->id]), [
|
->patchJson(route('api.companies.update', ['company' => $company->id]), [
|
||||||
'name' => 'A Changed Name',
|
'name' => 'A Changed Name',
|
||||||
|
'notes' => 'A Changed Note',
|
||||||
])
|
])
|
||||||
->assertStatus(200)
|
->assertStatus(200)
|
||||||
->assertStatusMessageIs('success');
|
->assertStatusMessageIs('success');
|
||||||
|
|
||||||
$this->assertEquals('A Changed Name', $company->fresh()->name);
|
$company->refresh();
|
||||||
|
$this->assertEquals('A Changed Name', $company->name);
|
||||||
|
$this->assertEquals('A Changed Note', $company->notes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue