mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Improve factory state name
This commit is contained in:
parent
c8e12ddb5c
commit
adfb8895df
|
@ -142,7 +142,7 @@ class AccessoryFactory extends Factory
|
|||
});
|
||||
}
|
||||
|
||||
public function checkedOut(User $user = null)
|
||||
public function checkedOutToUser(User $user = null)
|
||||
{
|
||||
return $this->afterCreating(function (Accessory $accessory) use ($user) {
|
||||
$accessory->users()->attach($accessory->id, [
|
||||
|
|
|
@ -19,7 +19,7 @@ class AccessoryCheckinTest extends TestCase
|
|||
public function testCheckingInAccessoryRequiresCorrectPermission()
|
||||
{
|
||||
$this->actingAs(User::factory()->create())
|
||||
->post(route('accessories.checkin.store', Accessory::factory()->checkedOut()->create()))
|
||||
->post(route('accessories.checkin.store', Accessory::factory()->checkedOutToUser()->create()))
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ class AccessoryCheckinTest extends TestCase
|
|||
Event::fake([CheckoutableCheckedIn::class]);
|
||||
|
||||
$user = User::factory()->create();
|
||||
$accessory = Accessory::factory()->checkedOut($user)->create();
|
||||
$accessory = Accessory::factory()->checkedOutToUser($user)->create();
|
||||
|
||||
$this->assertTrue($accessory->users->contains($user));
|
||||
|
||||
|
@ -45,7 +45,7 @@ class AccessoryCheckinTest extends TestCase
|
|||
Notification::fake();
|
||||
|
||||
$user = User::factory()->create();
|
||||
$accessory = Accessory::factory()->checkedOut($user)->create();
|
||||
$accessory = Accessory::factory()->checkedOutToUser($user)->create();
|
||||
|
||||
$accessory->category->update(['checkin_email' => true]);
|
||||
|
||||
|
@ -69,7 +69,7 @@ class AccessoryCheckinTest extends TestCase
|
|||
Notification::fake();
|
||||
|
||||
$user = User::factory()->create();
|
||||
$accessory = Accessory::factory()->checkedOut($user)->create();
|
||||
$accessory = Accessory::factory()->checkedOutToUser($user)->create();
|
||||
|
||||
$accessory->category->update(['checkin_email' => false]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue