test added #1xphe64
This commit is contained in:
parent
2810423a20
commit
8766849426
@ -112,6 +112,24 @@ class BillsTest extends FeatureTestCase
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testItShouldNotCreateBillWithNegativeQuantity()
|
||||||
|
{
|
||||||
|
$request = $this->getRequest();
|
||||||
|
|
||||||
|
$request['items'][0]['quantity'] = '-1';
|
||||||
|
|
||||||
|
$this->handleValidationExceptions();
|
||||||
|
|
||||||
|
$this->loginAs()
|
||||||
|
->post(route('bills.store'), $request)
|
||||||
|
->assertRedirect()
|
||||||
|
->assertInvalid(['items.0.quantity']);
|
||||||
|
|
||||||
|
$this->assertDatabaseMissing('documents', [
|
||||||
|
'document_number' => $request['document_number'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function testItShouldSeeBillUpdatePage()
|
public function testItShouldSeeBillUpdatePage()
|
||||||
{
|
{
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
@ -123,6 +123,24 @@ class InvoicesTest extends FeatureTestCase
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testItShouldNotCreateInvoiceWithNegativeQuantity()
|
||||||
|
{
|
||||||
|
$request = $this->getRequest();
|
||||||
|
|
||||||
|
$request['items'][0]['quantity'] = '-1';
|
||||||
|
|
||||||
|
$this->handleValidationExceptions();
|
||||||
|
|
||||||
|
$this->loginAs()
|
||||||
|
->post(route('invoices.store'), $request)
|
||||||
|
->assertRedirect()
|
||||||
|
->assertInvalid(['items.0.quantity']);
|
||||||
|
|
||||||
|
$this->assertDatabaseMissing('documents', [
|
||||||
|
'document_number' => $request['document_number'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function testItShouldSeeInvoiceUpdatePage()
|
public function testItShouldSeeInvoiceUpdatePage()
|
||||||
{
|
{
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user