Complete tests rewriting for main controllers

This commit is contained in:
Bubka
2021-11-15 00:21:07 +01:00
parent 627944a285
commit 22442f7af6
8 changed files with 854 additions and 1606 deletions

View File

@ -20,8 +20,8 @@ class IconControllerTest extends TestCase
$file = UploadedFile::fake()->image('testIcon.jpg');
$response = $this->json('POST', '/api/v1/icons', [
'icon' => $file,
])
'icon' => $file,
])
->assertCreated()
->assertJsonStructure([
'filename'
@ -35,8 +35,8 @@ class IconControllerTest extends TestCase
public function test_upload_with_invalid_data_returns_validation_error()
{
$response = $this->json('POST', '/api/v1/icons', [
'icon' => null,
])
'icon' => null,
])
->assertStatus(422);
}