User management (#185)

This commit is contained in:
Saeed Vaziry
2024-04-29 20:58:04 +02:00
committed by GitHub
parent 35f896eab1
commit d846acaa8d
106 changed files with 1490 additions and 434 deletions

View File

@ -17,7 +17,7 @@ public function test_add_email_channel(): void
{
$this->actingAs($this->user);
$this->post(route('notification-channels.add'), [
$this->post(route('settings.notification-channels.add'), [
'provider' => NotificationChannel::EMAIL,
'email' => 'email@example.com',
'label' => 'Email',
@ -40,7 +40,7 @@ public function test_cannot_add_email_channel(): void
$this->actingAs($this->user);
$this->post(route('notification-channels.add'), [
$this->post(route('settings.notification-channels.add'), [
'provider' => NotificationChannel::EMAIL,
'email' => 'email@example.com',
'label' => 'Email',
@ -61,7 +61,7 @@ public function test_add_slack_channel(): void
Http::fake();
$this->post(route('notification-channels.add'), [
$this->post(route('settings.notification-channels.add'), [
'provider' => NotificationChannel::SLACK,
'webhook_url' => 'https://hooks.slack.com/services/123/token',
'label' => 'Slack',
@ -84,7 +84,7 @@ public function test_cannot_add_slack_channel(): void
'slack.com/*' => Http::response(['ok' => false], 401),
]);
$this->post(route('notification-channels.add'), [
$this->post(route('settings.notification-channels.add'), [
'provider' => NotificationChannel::SLACK,
'webhook_url' => 'https://hooks.slack.com/services/123/token',
'label' => 'Slack',
@ -104,7 +104,7 @@ public function test_add_discord_channel(): void
Http::fake();
$this->post(route('notification-channels.add'), [
$this->post(route('settings.notification-channels.add'), [
'provider' => NotificationChannel::DISCORD,
'webhook_url' => 'https://discord.com/api/webhooks/123/token',
'label' => 'Discord',
@ -127,7 +127,7 @@ public function test_cannot_add_discord_channel(): void
'discord.com/*' => Http::response(['ok' => false], 401),
]);
$this->post(route('notification-channels.add'), [
$this->post(route('settings.notification-channels.add'), [
'provider' => NotificationChannel::DISCORD,
'webhook_url' => 'https://discord.com/api/webhooks/123/token',
'label' => 'Discord',
@ -147,7 +147,7 @@ public function test_add_telegram_channel(): void
Http::fake();
$this->post(route('notification-channels.add'), [
$this->post(route('settings.notification-channels.add'), [
'provider' => NotificationChannel::TELEGRAM,
'bot_token' => 'token',
'chat_id' => '123',
@ -172,7 +172,7 @@ public function test_cannot_add_telegram_channel(): void
'api.telegram.org/*' => Http::response(['ok' => false], 401),
]);
$this->post(route('notification-channels.add'), [
$this->post(route('settings.notification-channels.add'), [
'provider' => NotificationChannel::TELEGRAM,
'bot_token' => 'token',
'chat_id' => '123',
@ -193,7 +193,7 @@ public function test_see_channels_list(): void
$channel = \App\Models\NotificationChannel::factory()->create();
$this->get(route('notification-channels'))
$this->get(route('settings.notification-channels'))
->assertSuccessful()
->assertSee($channel->provider);
}
@ -204,7 +204,7 @@ public function test_delete_channel(): void
$channel = \App\Models\NotificationChannel::factory()->create();
$this->delete(route('notification-channels.delete', $channel->id))
$this->delete(route('settings.notification-channels.delete', $channel->id))
->assertSessionDoesntHaveErrors();
$this->assertDatabaseMissing('notification_channels', [