Skip to content

Commit

Permalink
fix: storage limit can be unlimited
Browse files Browse the repository at this point in the history
added tests
  • Loading branch information
SecurID committed Oct 31, 2023
1 parent b6348a8 commit 293fc76
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/Unit/Helpers/StorageHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,24 @@ public function it_checks_if_we_can_upload_another_file_in_the_account(): void

$this->assertFalse(StorageHelper::canUploadFile($account));
}

/** @test */
public function it_checks_if_we_can_upload_files_with_0_storage_limit(): void
{
$account = Account::factory()->create([
'storage_limit_in_mb' => 0,
]);

$this->assertTrue(StorageHelper::canUploadFile($account));

$vault = Vault::factory()->create([
'account_id' => $account->id,
]);
File::factory()->create([
'vault_id' => $vault->id,
'size' => 1024 * 1024,
]);

$this->assertTrue(StorageHelper::canUploadFile($account));
}
}

0 comments on commit 293fc76

Please sign in to comment.