Add extensive controller and model tests
This commit is contained in:
16
tests/Feature/VersionControllerTest.php
Normal file
16
tests/Feature/VersionControllerTest.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Setting;
|
||||
|
||||
it('returns version and build info', function (): void {
|
||||
Setting::updateOrCreate(['key' => 'version'], ['value' => '1.2.3']);
|
||||
Setting::updateOrCreate(['key' => 'build'], ['value' => '42']);
|
||||
|
||||
$response = $this->getJson('/api/version');
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertJsonFragment([
|
||||
'version' => '1.2.3',
|
||||
'build' => 42,
|
||||
]);
|
||||
});
|
||||
Reference in New Issue
Block a user