Fixes for tests

This commit is contained in:
David Bomba 2019-10-08 07:43:25 +10:00
parent cc85746af0
commit 7a78702a1f
3 changed files with 5 additions and 4 deletions

View File

@ -20,10 +20,10 @@ trait Uploadable
{ {
public function uploadLogo($file, $company, $entity) public function uploadLogo($file, $company, $entity)
{ {
if(($file) if($file)
{ {
$path = UploadAvatar::dispatchNow(($file, $company->company_key); $path = UploadAvatar::dispatchNow($file, $company->company_key);
if($path){ if($path){

View File

@ -95,7 +95,7 @@ class CompanyTest extends TestCase
])->post('/api/v1/companies/', ])->post('/api/v1/companies/',
[ [
'name' => 'A New Company', 'name' => 'A New Company',
'logo' => UploadedFile::fake()->create('avatar.pdf',100) 'company_logo' => UploadedFile::fake()->create('avatar.pdf',100)
] ]
) )
->assertStatus(302); ->assertStatus(302);

View File

@ -61,6 +61,7 @@ class UploadLogoTest extends TestCase
$response->assertStatus(200); $response->assertStatus(200);
$acc = $response->json(); $acc = $response->json();
\Log::error($acc);
$logo = $acc['data']['settings']['company_logo_url']; $logo = $acc['data']['settings']['company_logo_url'];
$logo_file = Storage::url($logo); $logo_file = Storage::url($logo);
@ -76,7 +77,7 @@ class UploadLogoTest extends TestCase
Storage::fake('avatars'); Storage::fake('avatars');
$data = [ $data = [
'logo' => "", 'company_logo' => "",
'name' => 'TestCompany' 'name' => 'TestCompany'
]; ];