applied jobs to tests

This commit is contained in:
denisdulici
2019-11-17 15:06:00 +03:00
parent 272905decc
commit 58048a1979
25 changed files with 194 additions and 186 deletions

View File

@@ -2,7 +2,7 @@
namespace Tests\Feature\Settings;
use App\Models\Setting\Category;
use App\Jobs\Setting\CreateCategory;
use Tests\Feature\FeatureTestCase;
class CategoriesTest extends FeatureTestCase
@@ -34,7 +34,7 @@ class CategoriesTest extends FeatureTestCase
public function testItShouldSeeCategoryUpdatePage()
{
$category = Category::create($this->getCategoryRequest());
$category = $this->dispatch(new CreateCategory($this->getCategoryRequest()));
$this->loginAs()
->get(route('categories.edit', ['category' => $category->id]))
@@ -46,7 +46,7 @@ class CategoriesTest extends FeatureTestCase
{
$request = $this->getCategoryRequest();
$category = Category::create($request);
$category = $this->dispatch(new CreateCategory($request));
$request['name'] = $this->faker->text(15);
@@ -59,7 +59,7 @@ class CategoriesTest extends FeatureTestCase
public function testItShouldDeleteCategory()
{
$category = Category::create($this->getCategoryRequest());
$category = $this->dispatch(new CreateCategory($this->getCategoryRequest()));
$this->loginAs()
->delete(route('categories.destroy', $category->id))
@@ -73,7 +73,7 @@ class CategoriesTest extends FeatureTestCase
return [
'company_id' => $this->company->id,
'name' => $this->faker->text(15),
'type' => 'other',
'type' => 'item',
'color' => $this->faker->text(15),
'enabled' => $this->faker->boolean ? 1 : 0
];

View File

@@ -2,7 +2,7 @@
namespace Tests\Feature\Settings;
use App\Models\Setting\Currency;
use App\Jobs\Setting\CreateCurrency;
use Tests\Feature\FeatureTestCase;
class CurrenciesTest extends FeatureTestCase
@@ -36,7 +36,7 @@ class CurrenciesTest extends FeatureTestCase
{
$request = $this->getCurrencyRequest();
$currency = Currency::create($request);
$currency = $this->dispatch(new CreateCurrency($request));
$request['name'] = $this->faker->text(15);
@@ -49,7 +49,7 @@ class CurrenciesTest extends FeatureTestCase
public function testItShouldDeleteCurrency()
{
$currency = Currency::create($this->getCurrencyRequest());
$currency = $this->dispatch(new CreateCurrency($this->getCurrencyRequest()));
$this->loginAs()
->delete(route('currencies.destroy', $currency->id))

View File

@@ -2,7 +2,7 @@
namespace Tests\Feature\Settings;
use App\Models\Setting\Tax;
use App\Jobs\Setting\CreateTax;
use Tests\Feature\FeatureTestCase;
class TaxesTest extends FeatureTestCase
@@ -36,7 +36,7 @@ class TaxesTest extends FeatureTestCase
{
$request = $this->getTaxRequest();
$tax = Tax::create($request);
$tax = $this->dispatch(new CreateTax($request));
$request['name'] = $this->faker->text(15);
@@ -49,7 +49,7 @@ class TaxesTest extends FeatureTestCase
public function testItShouldDeleteTax()
{
$tax = Tax::create($this->getTaxRequest());
$tax = $this->dispatch(new CreateTax($this->getTaxRequest()));
$this->loginAs()
->delete(route('taxes.destroy', $tax->id))