Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarnsley committed Sep 26, 2024
1 parent 8aba0ba commit c99e7b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/Rules/UniqueCaseInsensitiveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
$user = User::factory()->create(['username' => 'johndoe']);
$user->delete();

expect($this->subject->withTrashed()->passes(null, 'johndoe'))->toBeTrue();
expect($this->subject->withTrashed()->passes(null, 'johndoe'))->toBeFalse();
});

it('should exclude trashed data by default', function () {
$user = User::factory()->create(['username' => 'johndoe']);
$user->delete();

expect($this->subject->withTrashed()->passes(null, 'johndoe'))->toBeFalse();
expect($this->subject->passes(null, 'johndoe'))->toBeTrue();
});

it('should exclude specified data', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public function up()
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name')->index();
$table->string('name_slug')->nullable(false)->unique();
$table->string('username')->index()->nullable();
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
Expand All @@ -23,6 +24,7 @@ public function up()
$table->string('timezone')->default('UTC')->nullable();
$table->rememberToken();
$table->timestamps();
$table->softDeletes();
});
}
}

0 comments on commit c99e7b7

Please sign in to comment.