feat: remove test
This commit is contained in:
parent
3998f79056
commit
105637000d
|
|
@ -1,41 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
use App\Models\Hunts;
|
|
||||||
use App\Enums\HuntStatus;
|
|
||||||
use App\Enums\HuntDifficulty;
|
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
||||||
|
|
||||||
uses(RefreshDatabase::class);
|
|
||||||
|
|
||||||
test('authenticated user can filter participating hunts', function () {
|
|
||||||
$user = User::factory()->create();
|
|
||||||
|
|
||||||
$hunt = Hunts::create([
|
|
||||||
'title' => 'Test Hunt',
|
|
||||||
'slug' => 'test-hunt-' . uniqid(),
|
|
||||||
'status' => HuntStatus::PUBLISHED,
|
|
||||||
'difficulty' => HuntDifficulty::EASY,
|
|
||||||
'city' => 'Paris',
|
|
||||||
'creator_id' => $user->id,
|
|
||||||
'latitude' => 0,
|
|
||||||
'longitude' => 0,
|
|
||||||
'is_public' => true
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Participate
|
|
||||||
$hunt->participants()->attach($user->id, ['status' => 'started', 'current_step_number' => 1]);
|
|
||||||
|
|
||||||
$response = $this->actingAs($user)->getJson('/api/hunts?participating=true');
|
|
||||||
|
|
||||||
$response->assertStatus(200)
|
|
||||||
->assertJsonCount(1, 'data')
|
|
||||||
->assertJsonFragment(['id' => $hunt->id]);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('guest receiving empty list when filtering participating hunts', function () {
|
|
||||||
$response = $this->getJson('/api/hunts?participating=true');
|
|
||||||
|
|
||||||
$response->assertStatus(200)
|
|
||||||
->assertJsonCount(0, 'data');
|
|
||||||
});
|
|
||||||
Loading…
Reference in New Issue