测试
public function test_active_page_shows_active_and_not_inactive_contacts() {
$activeContact = factory(Contact::class)->create();
$inactiveContact = factory(Contact::class)->states('inactive')->create();
$this->get('active-contacts')
->assertSee($activeContact->name)
->assertDontSee($inactiveContact->name);
}public function test_contact_creation_works() {
$this->post('contacts', [
'email' => 'jim@bo.com'
]);
$this->assertDatabaseHas('contacts', [
'email' => 'jim@bo.com'
]);
}Last updated