1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Tests for payments (#3277)

This commit is contained in:
David Bomba 2020-02-02 18:54:52 +11:00 committed by GitHub
parent 79c57aa8da
commit 84461858f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -32,7 +32,7 @@ Route::group(['api_secret_check', 'email_db'], function () {
});
Route::group(['middleware' => ['api_db', 'api_secret_check', 'token_auth', 'locale'], 'prefix' => 'api/v1', 'as' => 'api.'], function () {
Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'api/v1', 'as' => 'api.'], function () {
Route::resource('activities', 'ActivityController'); // name = (clients. index / create / show / update / destroy / edit

View File

@ -1073,6 +1073,14 @@ class PaymentTest extends TestCase
}
$response->assertStatus(200);
$arr = $response->json();
$payment_id = $arr['data']['id'];
$payment = Payment::whereId($this->decodePrimaryKey($payment_id))->first();
$this->assertEquals(round($payment->amount,2), $this->invoice->amount);
$this->assertEquals(round($payment->applied,2), $this->invoice->amount);
}
}