updated test routes

This commit is contained in:
denisdulici 2020-01-13 10:55:19 +03:00
parent b6f916ce4b
commit e5a11c3f44
16 changed files with 67 additions and 31 deletions

View File

@ -38,7 +38,7 @@ class PermissionsTest extends FeatureTestCase
$permission = $this->dispatch(new CreatePermission($this->getPermissionRequest()));
$this->loginAs()
->get(route('permissions.edit', ['permission' => $permission->id]))
->get(route('permissions.edit', $permission->id))
->assertStatus(200)
->assertSee($permission->name);
}

View File

@ -39,7 +39,7 @@ class RolesTest extends FeatureTestCase
$role = $this->dispatch(new CreateRole($this->getRoleRequest()));
$this->loginAs()
->get(route('roles.edit', ['role' => $role->id]))
->get(route('roles.edit', $role->id))
->assertStatus(200)
->assertSee($role->name);
}

View File

@ -38,7 +38,7 @@ class UsersTest extends FeatureTestCase
$user = $this->dispatch(new CreateUser($this->getRequest()));
$this->loginAs()
->get(route('users.edit', ['user' => $user->id]))
->get(route('users.edit', $user->id))
->assertStatus(200)
->assertSee($user->name);
}

View File

@ -38,7 +38,7 @@ class AccountsTest extends FeatureTestCase
$account = $this->dispatch(new CreateAccount($this->getRequest()));
$this->loginAs()
->get(route('accounts.edit', ['account' => $account->id]))
->get(route('accounts.edit', $account->id))
->assertStatus(200)
->assertSee($account->name);
}
@ -52,7 +52,7 @@ class AccountsTest extends FeatureTestCase
$request['name'] = $this->faker->text(5);
$this->loginAs()
->patch(route('accounts.update', ['account' => $account->id]), $request)
->patch(route('accounts.update', $account->id), $request)
->assertStatus(200);
$this->assertFlashLevel('success');
@ -63,7 +63,7 @@ class AccountsTest extends FeatureTestCase
$account = $this->dispatch(new CreateAccount($this->getRequest()));
$this->loginAs()
->delete(route('accounts.destroy', ['account' => $account]))
->delete(route('accounts.destroy', $account->id))
->assertStatus(200);
$this->assertFlashLevel('success');

View File

@ -37,7 +37,7 @@ class ReconciliationsTest extends FeatureTestCase
$reconciliation = $this->dispatch(new CreateReconciliation($this->getReconciliationRequest()));
$this->loginAs()
->get(route('reconciliations.edit', ['reconciliation' => $reconciliation->id]))
->get(route('reconciliations.edit', $reconciliation->id))
->assertStatus(200)
->assertSeeText(trans_choice('general.reconciliations', 2));
}
@ -62,7 +62,7 @@ class ReconciliationsTest extends FeatureTestCase
$reconciliation = $this->dispatch(new CreateReconciliation($this->getReconciliationRequest()));
$this->loginAs()
->delete(route('reconciliations.destroy', ['reconciliation' => $reconciliation]))
->delete(route('reconciliations.destroy', $reconciliation->id))
->assertStatus(200);
$this->assertFlashLevel('success');

View File

@ -38,7 +38,7 @@ class TransfersTest extends FeatureTestCase
$transfer = $this->dispatch(new CreateTransfer($this->getRequest()));
$this->loginAs()
->get(route('transfers.edit', ['transfer' => $transfer->id]))
->get(route('transfers.edit', $transfer->id))
->assertStatus(200)
->assertSee($transfer->description);
}
@ -52,7 +52,7 @@ class TransfersTest extends FeatureTestCase
$request['description'] = $this->faker->text(10);
$this->loginAs()
->patch(route('transfers.update', ['transfer' => $transfer->id]), $request)
->patch(route('transfers.update', $transfer->id), $request)
->assertStatus(200);
$this->assertFlashLevel('success');
@ -63,7 +63,7 @@ class TransfersTest extends FeatureTestCase
$transfer = $this->dispatch(new CreateTransfer($this->getRequest()));
$this->loginAs()
->delete(route('transfers.destroy', ['transfer' => $transfer->id]))
->delete(route('transfers.destroy', $transfer->id))
->assertStatus(200);
$this->assertFlashLevel('success');

View File

@ -38,7 +38,7 @@ class ItemsTest extends FeatureTestCase
$item = $this->dispatch(new CreateItem($this->getRequest()));
$this->loginAs()
->get(route('items.edit', ['item' => $item->id]))
->get(route('items.edit', $item->id))
->assertStatus(200)
->assertSee($item->name);
}
@ -63,7 +63,7 @@ class ItemsTest extends FeatureTestCase
$item = $this->dispatch(new CreateItem($this->getRequest()));
$this->loginAs()
->delete(route('items.destroy', ['item' => $item]))
->delete(route('items.destroy', $item->id))
->assertStatus(200);
$this->assertFlashLevel('success');

View File

@ -46,9 +46,8 @@ class BillsTest extends FeatureTestCase
$bill = $this->dispatch(new CreateBill($this->getBillRequest()));
$this->loginAs()
->get(route('bills.edit', ['bill' => $bill->id]))
->get(route('bills.edit', $bill->id))
->assertStatus(200)
->assertSee($bill->contact_name)
->assertSee($bill->contact_email);
}

View File

@ -33,6 +33,16 @@ class PaymentsTest extends FeatureTestCase
$this->assertFlashLevel('success');
}
public function testItShouldSeePaymentUpdatePage()
{
$payment = $this->dispatch(new CreateTransaction($this->getRequest()));
$this->loginAs()
->get(route('payments.edit', $payment->id))
->assertStatus(200)
->assertSee($payment->amount);
}
public function testItShouldUpdatePayment()
{
$request = $this->getRequest();

View File

@ -38,7 +38,7 @@ class VendorsTest extends FeatureTestCase
$vendor = $this->dispatch(new CreateContact($this->getRequest()));
$this->loginAs()
->get(route('vendors.show', ['vendor' => $vendor->id]))
->get(route('vendors.show', $vendor->id))
->assertStatus(200)
->assertSee($vendor->email);
}
@ -48,10 +48,9 @@ class VendorsTest extends FeatureTestCase
$vendor = $this->dispatch(new CreateContact($this->getRequest()));
$this->loginAs()
->get(route('vendors.edit', ['vendor' => $vendor->id]))
->get(route('vendors.edit', $vendor->id))
->assertStatus(200)
->assertSee($vendor->email)
->assertSee($vendor->name);
->assertSee($vendor->email);
}
public function testItShouldUpdateVendor()

View File

@ -55,7 +55,7 @@ class CustomersTest extends FeatureTestCase
$customer = $this->dispatch(new CreateContact($this->getRequest()));
$this->loginAs()
->get(route('customers.show', ['customer' => $customer->id]))
->get(route('customers.show', $customer->id))
->assertStatus(200)
->assertSee($customer->email);
}
@ -65,10 +65,9 @@ class CustomersTest extends FeatureTestCase
$customer = $this->dispatch(new CreateContact($this->getRequest()));
$this->loginAs()
->get(route('customers.edit', ['customer' => $customer->id]))
->get(route('customers.edit', $customer->id))
->assertStatus(200)
->assertSee($customer->email)
->assertSee($customer->name);
->assertSee($customer->email);
}
public function testItShouldUpdateCustomer()

View File

@ -46,9 +46,8 @@ class InvoicesTest extends FeatureTestCase
$invoice = $this->dispatch(new CreateInvoice($this->getInvoiceRequest()));
$this->loginAs()
->get(route('invoices.edit', ['invoice' => $invoice->id]))
->get(route('invoices.edit', $invoice->id))
->assertStatus(200)
->assertSee($invoice->contact_name)
->assertSee($invoice->contact_email);
}

View File

@ -33,6 +33,16 @@ class RevenuesTest extends FeatureTestCase
$this->assertFlashLevel('success');
}
public function testItShouldSeeRevenueUpdatePage()
{
$revenue = $this->dispatch(new CreateTransaction($this->getRequest()));
$this->loginAs()
->get(route('revenues.edit', $revenue->id))
->assertStatus(200)
->assertSee($revenue->amount);
}
public function testItShouldUpdateRevenue()
{
$request = $this->getRequest();

View File

@ -38,7 +38,7 @@ class CategoriesTest extends FeatureTestCase
$category = $this->dispatch(new CreateCategory($this->getRequest()));
$this->loginAs()
->get(route('categories.edit', ['category' => $category->id]))
->get(route('categories.edit', $category->id))
->assertStatus(200)
->assertSee($category->name);
}

View File

@ -33,6 +33,16 @@ class CurrenciesTest extends FeatureTestCase
$this->assertFlashLevel('success');
}
public function testItShouldSeeCurrencyUpdatePage()
{
$currency = $this->dispatch(new CreateCurrency($this->getRequest()));
$this->loginAs()
->get(route('currencies.edit', $currency->id))
->assertStatus(200)
->assertSee($currency->code);
}
public function testItShouldUpdateCurrency()
{
$request = $this->getRequest();

View File

@ -33,6 +33,16 @@ class TaxesTest extends FeatureTestCase
$this->assertFlashLevel('success');
}
public function testItShouldSeeTaxUpdatePage()
{
$tax = $this->dispatch(new CreateTax($this->getRequest()));
$this->loginAs()
->get(route('taxes.edit', $tax->id))
->assertStatus(200)
->assertSee($tax->name);
}
public function testItShouldUpdateTax()
{
$request = $this->getRequest();