v2 first commit
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Tests\Feature\Incomes;
|
||||
|
||||
use App\Models\Income\Revenue;
|
||||
use App\Models\Banking\Transaction;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Tests\Feature\FeatureTestCase;
|
||||
|
||||
@ -28,8 +28,7 @@ class RevenuesTest extends FeatureTestCase
|
||||
{
|
||||
$this->loginAs()
|
||||
->post(route('revenues.store'), $this->getRevenueRequest())
|
||||
->assertStatus(302)
|
||||
->assertRedirect(route('revenues.index'));
|
||||
->assertStatus(200);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
}
|
||||
@ -38,26 +37,24 @@ class RevenuesTest extends FeatureTestCase
|
||||
{
|
||||
$request = $this->getRevenueRequest();
|
||||
|
||||
$revenue = Revenue::create($request);
|
||||
$revenue = Transaction::create($request);
|
||||
|
||||
$request['name'] = $this->faker->text(15);
|
||||
|
||||
$this->loginAs()
|
||||
->patch(route('revenues.update', $revenue->id), $request)
|
||||
->assertStatus(302)
|
||||
->assertRedirect(route('revenues.index'));
|
||||
->assertStatus(200);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
}
|
||||
|
||||
public function testItShouldDeleteRevenue()
|
||||
{
|
||||
$revenue = Revenue::create($this->getRevenueRequest());
|
||||
$revenue = Transaction::create($this->getRevenueRequest());
|
||||
|
||||
$this->loginAs()
|
||||
->delete(route('revenues.destroy', $revenue->id))
|
||||
->assertStatus(302)
|
||||
->assertRedirect(route('revenues.index'));
|
||||
->assertStatus(200);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
}
|
||||
@ -68,16 +65,16 @@ class RevenuesTest extends FeatureTestCase
|
||||
|
||||
return [
|
||||
'company_id' => $this->company->id,
|
||||
'customer_id' => '',
|
||||
'account_id' => setting('general.default_account'),
|
||||
'type' => 'income',
|
||||
'account_id' => setting('default.account'),
|
||||
'paid_at' => $this->faker->date(),
|
||||
'amount' => $this->faker->randomFloat(2, 2),
|
||||
'currency_code' => setting('general.default_currency'),
|
||||
'currency_code' => setting('default.currency'),
|
||||
'currency_rate' => '1',
|
||||
'description' => $this->faker->text(5),
|
||||
'category_id' => $this->company->categories()->type('income')->first()->id,
|
||||
'reference' => $this->faker->text(5),
|
||||
'payment_method' => setting('general.default_payment_method'),
|
||||
'payment_method' => setting('default.payment_method'),
|
||||
'attachment' => $attachment,
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user