2024-08-16 02:51:49 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Feature\Settings;
|
|
|
|
|
|
|
|
use Tests\TestCase;
|
|
|
|
use App\Models\User;
|
|
|
|
|
|
|
|
|
|
|
|
class AlertsSettingTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testPermissionRequiredToViewAlertSettings()
|
|
|
|
{
|
|
|
|
$this->actingAs(User::factory()->create())
|
|
|
|
->get(route('settings.alerts.index'))
|
|
|
|
->assertForbidden();
|
|
|
|
}
|
|
|
|
|
2024-10-09 11:30:55 -07:00
|
|
|
public function testAdminCCEmailArrayCanBeSaved()
|
|
|
|
{
|
|
|
|
$response = $this->actingAs(User::factory()->superuser()->create())
|
|
|
|
->post(route('settings.alerts.save', ['alert_email' => 'me@example.com,you@example.com']))
|
|
|
|
->assertStatus(302)
|
|
|
|
->assertValid('alert_email')
|
|
|
|
->assertRedirect(route('settings.index'))
|
|
|
|
->assertSessionHasNoErrors();
|
|
|
|
$this->followRedirects($response)->assertSee('alert-success');
|
|
|
|
}
|
|
|
|
|
2024-08-16 02:51:49 -07:00
|
|
|
}
|