Ensure user is stored

This commit is contained in:
Marcus Moore 2024-09-04 15:44:52 -07:00
parent 487d88c012
commit 9f832a93c9
No known key found for this signature in database

View file

@ -56,10 +56,12 @@ class CreateAccessoriesTest extends TestCase
'notes' => 'Some notes here',
];
$this->actingAs(User::factory()->createAccessories()->create())
$user = User::factory()->createAccessories()->create();
$this->actingAs($user)
->post(route('accessories.store'), array_merge($data, ['redirect_option' => 'index']))
->assertRedirect(route('accessories.index'));
$this->assertDatabaseHas('accessories', $data);
$this->assertDatabaseHas('accessories', array_merge($data, ['user_id' => $user->id]));
}
}