company gateways

This commit is contained in:
David Bomba 2019-10-03 14:27:17 +10:00
parent 3e3cde2e1e
commit 23265fb9e3
2 changed files with 41 additions and 1 deletions

View File

@ -23,7 +23,7 @@ use Tests\TestCase;
/**
* @test
*/
class ClientApiTest extends TestCase
class CompanyGatewayApiTest extends TestCase
{
use MakesHash;
use DatabaseTransactions;

View File

@ -67,4 +67,44 @@ class UploadLogoTest extends TestCase
public function testLogoUploadfailure()
{
Storage::fake('avatars');
$data = [
'logo' => "",
'name' => 'TestCompany'
];
$response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token,
])->put('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $data);
$response->assertStatus(302);
//Log::error(print_r($response->json(),1));
}
public function testLogoUploadNoAttribute()
{
Storage::fake('avatars');
$data = [
'name' => 'TestCompany'
];
$response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token,
])->put('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $data);
$response->assertStatus(200);
//Log::error(print_r($response->json(),1));
}
}