mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Tests for company update
This commit is contained in:
parent
5e67916117
commit
8ec20f4a78
@ -47,6 +47,42 @@ class CompanyTest extends TestCase
|
|||||||
$this->makeTestData();
|
$this->makeTestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testUpdateCompanyPropertyInvoiceTaskHours()
|
||||||
|
{
|
||||||
|
|
||||||
|
$company_update = [
|
||||||
|
'invoice_task_hours' => true
|
||||||
|
];
|
||||||
|
|
||||||
|
$response = $this->withHeaders([
|
||||||
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
|
'X-API-TOKEN' => $this->token,
|
||||||
|
])->putJson('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $company_update)
|
||||||
|
->assertStatus(200);
|
||||||
|
|
||||||
|
|
||||||
|
$arr = $response->json();
|
||||||
|
|
||||||
|
$this->assertTrue($arr['data']['invoice_task_hours']);
|
||||||
|
|
||||||
|
|
||||||
|
$company_update = [
|
||||||
|
'invoice_task_hours' => false
|
||||||
|
];
|
||||||
|
|
||||||
|
$response = $this->withHeaders([
|
||||||
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
|
'X-API-TOKEN' => $this->token,
|
||||||
|
])->putJson('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $company_update)
|
||||||
|
->assertStatus(200);
|
||||||
|
|
||||||
|
|
||||||
|
$arr = $response->json();
|
||||||
|
|
||||||
|
$this->assertFalse($arr['data']['invoice_task_hours']);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function testCompanyList()
|
public function testCompanyList()
|
||||||
{
|
{
|
||||||
$this->withoutMiddleware(PasswordProtection::class);
|
$this->withoutMiddleware(PasswordProtection::class);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user