From f4bea090a842563936e06cf0673c823283e5581d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 3 Sep 2024 09:40:13 +1000 Subject: [PATCH] Fixes for tests --- tests/Integration/UpdateCompanyUserTest.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/Integration/UpdateCompanyUserTest.php b/tests/Integration/UpdateCompanyUserTest.php index 28dc6797f2e7..8f7a3a86a2f5 100644 --- a/tests/Integration/UpdateCompanyUserTest.php +++ b/tests/Integration/UpdateCompanyUserTest.php @@ -74,11 +74,11 @@ class UpdateCompanyUserTest extends TestCase $response = null; - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->putJson('/api/v1/company_users/'.$this->encodePrimaryKey($this->user->id).'/preferences?include=company_user', $settings); - + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson('/api/v1/company_users/'.$this->encodePrimaryKey($this->user->id).'/preferences?include=company_user', $settings); + $response->assertStatus(200); $arr = $response->json(); @@ -91,7 +91,6 @@ class UpdateCompanyUserTest extends TestCase public function testUpdatingCompanyUserAsAdmin() { - // User::unguard(); $settings = new \stdClass(); $settings->invoice = 'ninja'; @@ -105,11 +104,11 @@ class UpdateCompanyUserTest extends TestCase $response = null; - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->putJson('/api/v1/company_users/'.$this->encodePrimaryKey($this->user->id), $user); - + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson("/api/v1/company_users/{$this->user->hashed_id}", $user); + $response->assertStatus(200); $arr = $response->json();