mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Added a setting test and validation on settings
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
e8f1190628
commit
3167ee91d1
|
@ -74,7 +74,10 @@ class Setting extends Model
|
|||
'login_remote_user_header_name' => 'string|nullable',
|
||||
'thumbnail_max_h' => 'numeric|max:500|min:25',
|
||||
'pwd_secure_min' => 'numeric|required|min:8',
|
||||
'alert_threshold' => 'numeric|nullable',
|
||||
'alert_interval' => 'numeric|nullable',
|
||||
'audit_warning_days' => 'numeric|nullable',
|
||||
'due_checkin_days' => 'numeric|nullable',
|
||||
'audit_interval' => 'numeric|nullable',
|
||||
'custom_forgot_pass_url' => 'url|nullable',
|
||||
'privacy_policy_link' => 'nullable|url',
|
||||
|
|
23
tests/Feature/Settings/AlertsSettingTest.php
Normal file
23
tests/Feature/Settings/AlertsSettingTest.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Settings;
|
||||
|
||||
use App\Models\Asset;
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Models\User;
|
||||
use App\Models\Setting;
|
||||
|
||||
|
||||
class AlertsSettingTest extends TestCase
|
||||
{
|
||||
public function testPermissionRequiredToViewAlertSettings()
|
||||
{
|
||||
$asset = Asset::factory()->create();
|
||||
$this->actingAs(User::factory()->create())
|
||||
->get(route('settings.alerts.index'))
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue