Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Harrk committed May 2, 2024
1 parent a92c4be commit 0de17e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/Feature/ShortUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
'user_id' => $user->id,
'status' => ShortUrlStatus::INACTIVE,
'max_visits' => 1,
'clicks' => 0,
]);

$shortUrl->max_visits = 10;
Expand Down
5 changes: 4 additions & 1 deletion tests/Feature/ShortUrlViewedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
ShortUrlViewed::class,
]);

$shortUrl = ShortUrl::factory()->create();
$shortUrl = ShortUrl::factory()->create([
'clicks' => 0,
]);

$response = $this->get($shortUrl->short_url, [
'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.1',
Expand Down Expand Up @@ -70,6 +72,7 @@
test('Short URL is set to inactive if max visits is set', function () {
$shortUrl = ShortUrl::factory()->create([
'max_visits' => 1,
'clicks' => 0,
]);

$response = $this->get($shortUrl->short_url, [
Expand Down

0 comments on commit 0de17e0

Please sign in to comment.