create/get upload request backend

This commit is contained in:
Čarodej
2022-02-17 16:55:35 +01:00
parent 45a3b5415b
commit 6db8b0662a
15 changed files with 273 additions and 28 deletions

View File

@@ -25,9 +25,10 @@ class DashboardTest extends TestCase
->assertStatus(200)
->assertExactJson([
'app' => [
'earnings' => '$0.00',
'license' => 'extended',
'version' => config('vuefilemanager.version'),
'earnings' => '$0.00',
'isRunningCron' => false,
'license' => 'extended',
'version' => config('vuefilemanager.version'),
],
'disk' => [
'download' => [

View File

@@ -24,7 +24,7 @@ class UploadRequestTest extends TestCase
/**
* @test
*/
public function user_create_upload_request()
public function user_create_upload_request_with_email()
{
$user = User::factory()
->hasSettings()
@@ -48,6 +48,32 @@ class UploadRequestTest extends TestCase
Notification::assertTimesSent(1, UploadRequestNotification::class);
}
/**
* @test
*/
public function user_create_upload_request_without_email()
{
$user = User::factory()
->hasSettings()
->create();
$this
->actingAs($user)
->postJson("/api/upload-request", [
'folder_id' => '00cacdb9-1d09-4a32-8ad7-c0d45d66b758',
'notes' => 'Please send me your files...',
])
->assertCreated();
$this->assertDatabasehas('upload_requests', [
'folder_id' => '00cacdb9-1d09-4a32-8ad7-c0d45d66b758',
'notes' => 'Please send me your files...',
'email' => null,
]);
Notification::assertNothingSent();
}
/**
* @test
*/