Fix API tests

This commit is contained in:
James Cole
2020-03-15 15:32:09 +01:00
parent 208bece7ea
commit 328c960950
24 changed files with 112 additions and 20 deletions

View File

@@ -50,6 +50,7 @@ class BudgetControllerTest extends TestCase
{
parent::setUp();
Passport::actingAs($this->user());
$this->mockDefaultConfiguration();
Log::info(sprintf('Now in %s.', get_class($this)));
}
@@ -86,7 +87,7 @@ class BudgetControllerTest extends TestCase
];
// test API
$response = $this->post(route('api.v1.budgets.store'), $data);
$response = $this->post(route('api.v1.budgets.store'), $data, ['Accept' => 'application/json']);
$response->assertStatus(200);
$response->assertJson(['data' => ['type' => 'budgets', 'links' => true],]);
$response->assertHeader('Content-Type', 'application/vnd.api+json');