From 8d15e181c3846e06276b5085e37520e67dfade0a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 24 Aug 2021 11:32:33 +1000 Subject: [PATCH] Tests for recurring Expenses --- tests/Feature/RecurringExpenseApiTest.php | 48 +++++++++++------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/Feature/RecurringExpenseApiTest.php b/tests/Feature/RecurringExpenseApiTest.php index e657efe98dc9..d566cb96e338 100644 --- a/tests/Feature/RecurringExpenseApiTest.php +++ b/tests/Feature/RecurringExpenseApiTest.php @@ -139,35 +139,35 @@ class RecurringExpenseApiTest extends TestCase $this->assertNotNull($arr['data'][0]['archived_at']); } -// public function testRecurringExpenseRestored() -// { -// $data = [ -// 'ids' => [$this->encodePrimaryKey($this->recurring_expense->id)], -// ]; + public function testRecurringExpenseRestored() + { + $data = [ + 'ids' => [$this->encodePrimaryKey($this->recurring_expense->id)], + ]; -// $response = $this->withHeaders([ -// 'X-API-SECRET' => config('ninja.api_secret'), -// 'X-API-TOKEN' => $this->token, -// ])->post('/api/v1/recurring_expenses/bulk?action=restore', $data); + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/recurring_expenses/bulk?action=restore', $data); -// $arr = $response->json(); + $arr = $response->json(); -// $this->assertEquals(0, $arr['data'][0]['archived_at']); -// } + $this->assertEquals(0, $arr['data'][0]['archived_at']); + } -// public function testRecurringExpenseDeleted() -// { -// $data = [ -// 'ids' => [$this->encodePrimaryKey($this->recurring_expense->id)], -// ]; + public function testRecurringExpenseDeleted() + { + $data = [ + 'ids' => [$this->encodePrimaryKey($this->recurring_expense->id)], + ]; -// $response = $this->withHeaders([ -// 'X-API-SECRET' => config('ninja.api_secret'), -// 'X-API-TOKEN' => $this->token, -// ])->post('/api/v1/recurring_expenses/bulk?action=delete', $data); + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/recurring_expenses/bulk?action=delete', $data); -// $arr = $response->json(); + $arr = $response->json(); -// $this->assertTrue($arr['data'][0]['is_deleted']); -// } + $this->assertTrue($arr['data'][0]['is_deleted']); + } }