added more db asserts
This commit is contained in:
@@ -26,16 +26,22 @@ class CategoriesTest extends FeatureTestCase
|
||||
|
||||
public function testItShouldCreateCategory()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$this->loginAs()
|
||||
->post(route('categories.store'), $this->getRequest())
|
||||
->post(route('categories.store'), $request)
|
||||
->assertStatus(200);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertDatabaseHas('categories', $request);
|
||||
}
|
||||
|
||||
public function testItShouldSeeCategoryUpdatePage()
|
||||
{
|
||||
$category = $this->dispatch(new CreateCategory($this->getRequest()));
|
||||
$request = $this->getRequest();
|
||||
|
||||
$category = $this->dispatch(new CreateCategory($request));
|
||||
|
||||
$this->loginAs()
|
||||
->get(route('categories.edit', $category->id))
|
||||
@@ -57,17 +63,23 @@ class CategoriesTest extends FeatureTestCase
|
||||
->assertSee($request['name']);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertDatabaseHas('categories', $request);
|
||||
}
|
||||
|
||||
public function testItShouldDeleteCategory()
|
||||
{
|
||||
$category = $this->dispatch(new CreateCategory($this->getRequest()));
|
||||
$request = $this->getRequest();
|
||||
|
||||
$category = $this->dispatch(new CreateCategory($request));
|
||||
|
||||
$this->loginAs()
|
||||
->delete(route('categories.destroy', $category->id))
|
||||
->assertStatus(200);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertSoftDeleted('categories', $request);
|
||||
}
|
||||
|
||||
public function getRequest()
|
||||
|
||||
@@ -26,16 +26,22 @@ class CurrenciesTest extends FeatureTestCase
|
||||
|
||||
public function testItShouldCreateCurrency()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$this->loginAs()
|
||||
->post(route('currencies.store'), $this->getRequest())
|
||||
->post(route('currencies.store'), $request)
|
||||
->assertStatus(200);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertDatabaseHas('currencies', $request);
|
||||
}
|
||||
|
||||
public function testItShouldSeeCurrencyUpdatePage()
|
||||
{
|
||||
$currency = $this->dispatch(new CreateCurrency($this->getRequest()));
|
||||
$request = $this->getRequest();
|
||||
|
||||
$currency = $this->dispatch(new CreateCurrency($request));
|
||||
|
||||
$this->loginAs()
|
||||
->get(route('currencies.edit', $currency->id))
|
||||
@@ -57,17 +63,23 @@ class CurrenciesTest extends FeatureTestCase
|
||||
->assertSee($request['name']);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertDatabaseHas('currencies', $request);
|
||||
}
|
||||
|
||||
public function testItShouldDeleteCurrency()
|
||||
{
|
||||
$currency = $this->dispatch(new CreateCurrency($this->getRequest()));
|
||||
$request = $this->getRequest();
|
||||
|
||||
$currency = $this->dispatch(new CreateCurrency($request));
|
||||
|
||||
$this->loginAs()
|
||||
->delete(route('currencies.destroy', $currency->id))
|
||||
->assertStatus(200);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertSoftDeleted('currencies', $request);
|
||||
}
|
||||
|
||||
public function getRequest()
|
||||
|
||||
@@ -26,16 +26,22 @@ class TaxesTest extends FeatureTestCase
|
||||
|
||||
public function testItShouldCreateTax()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$this->loginAs()
|
||||
->post(route('taxes.store'), $this->getRequest())
|
||||
->post(route('taxes.store'), $request)
|
||||
->assertStatus(200);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertDatabaseHas('taxes', $request);
|
||||
}
|
||||
|
||||
public function testItShouldSeeTaxUpdatePage()
|
||||
{
|
||||
$tax = $this->dispatch(new CreateTax($this->getRequest()));
|
||||
$request = $this->getRequest();
|
||||
|
||||
$tax = $this->dispatch(new CreateTax($request));
|
||||
|
||||
$this->loginAs()
|
||||
->get(route('taxes.edit', $tax->id))
|
||||
@@ -57,17 +63,23 @@ class TaxesTest extends FeatureTestCase
|
||||
->assertSee($request['name']);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertDatabaseHas('taxes', $request);
|
||||
}
|
||||
|
||||
public function testItShouldDeleteTax()
|
||||
{
|
||||
$tax = $this->dispatch(new CreateTax($this->getRequest()));
|
||||
$request = $this->getRequest();
|
||||
|
||||
$tax = $this->dispatch(new CreateTax($request));
|
||||
|
||||
$this->loginAs()
|
||||
->delete(route('taxes.destroy', $tax->id))
|
||||
->assertStatus(200);
|
||||
|
||||
$this->assertFlashLevel('success');
|
||||
|
||||
$this->assertDatabaseHas('taxes', $request);
|
||||
}
|
||||
|
||||
public function getRequest()
|
||||
|
||||
Reference in New Issue
Block a user