Save workspace changes
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Models\RankList;
|
||||
use App\Models\User;
|
||||
use App\Services\RankingService;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
@@ -23,6 +24,13 @@ class RankGlobalTrendingTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
Cache::flush();
|
||||
}
|
||||
|
||||
// ── Test 1: ranked order ───────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
@@ -52,7 +60,7 @@ class RankGlobalTrendingTest extends TestCase
|
||||
'scope_type' => 'global',
|
||||
'scope_id' => 0,
|
||||
'list_type' => 'trending',
|
||||
'model_version' => 'rank_v1',
|
||||
'model_version' => (string) config('ranking.model_version', 'rank_v1'),
|
||||
'artwork_ids' => $rankedOrder,
|
||||
'computed_at' => now(),
|
||||
]);
|
||||
@@ -78,7 +86,7 @@ class RankGlobalTrendingTest extends TestCase
|
||||
// Meta block is present
|
||||
$response->assertJsonPath('meta.list_type', 'trending');
|
||||
$response->assertJsonPath('meta.fallback', false);
|
||||
$response->assertJsonPath('meta.model_version', 'rank_v1');
|
||||
$response->assertJsonPath('meta.model_version', (string) config('ranking.model_version', 'rank_v1'));
|
||||
}
|
||||
|
||||
// ── Test 2: diversity constraint ───────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user