test added #1xphe64
This commit is contained in:
		@@ -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();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user