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())); $permission = $this->dispatch(new CreatePermission($this->getPermissionRequest()));
$this->loginAs() $this->loginAs()
->get(route('permissions.edit', ['permission' => $permission->id])) ->get(route('permissions.edit', $permission->id))
->assertStatus(200) ->assertStatus(200)
->assertSee($permission->name); ->assertSee($permission->name);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,6 +33,16 @@ class PaymentsTest extends FeatureTestCase
$this->assertFlashLevel('success'); $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() public function testItShouldUpdatePayment()
{ {
$request = $this->getRequest(); $request = $this->getRequest();

View File

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

View File

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

View File

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

View File

@ -33,6 +33,16 @@ class RevenuesTest extends FeatureTestCase
$this->assertFlashLevel('success'); $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() public function testItShouldUpdateRevenue()
{ {
$request = $this->getRequest(); $request = $this->getRequest();

View File

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

View File

@ -33,6 +33,16 @@ class CurrenciesTest extends FeatureTestCase
$this->assertFlashLevel('success'); $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() public function testItShouldUpdateCurrency()
{ {
$request = $this->getRequest(); $request = $this->getRequest();

View File

@ -33,6 +33,16 @@ class TaxesTest extends FeatureTestCase
$this->assertFlashLevel('success'); $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() public function testItShouldUpdateTax()
{ {
$request = $this->getRequest(); $request = $this->getRequest();