mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 20:51:09 -04:00
fix tests
This commit is contained in:
@ -7,7 +7,6 @@ use Crater\Models\Expense;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
use function Pest\Laravel\getJson;
|
||||
|
||||
beforeEach(function () {
|
||||
@ -32,14 +31,11 @@ test('get customer expenses', function () {
|
||||
test('get customer expense', function () {
|
||||
$customer = Auth::guard('customer')->user();
|
||||
|
||||
$expense = Expense::factory()->create();
|
||||
|
||||
getJson("/api/v1/{$customer->company->slug}/customer/expenses/{$expense->id}")->assertOk();
|
||||
|
||||
$this->assertDatabaseHas('expenses', [
|
||||
'expense_category_id' => $expense['expense_category_id'],
|
||||
'amount' => $expense['amount'],
|
||||
'exchange_rate' => $expense['exchange_rate'],
|
||||
'notes' => $expense['notes'],
|
||||
$expense = Expense::factory()->create([
|
||||
'customer_id' => $customer->id,
|
||||
'company_id' => $customer->company->id
|
||||
]);
|
||||
|
||||
getJson("/api/v1/{$customer->company->slug}/customer/expenses/{$expense->id}")
|
||||
->assertOk();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user