diff --git a/tests/Feature/Auth/PermissionsTest.php b/tests/Feature/Auth/PermissionsTest.php index d6907e33c..7dcaf5333 100644 --- a/tests/Feature/Auth/PermissionsTest.php +++ b/tests/Feature/Auth/PermissionsTest.php @@ -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); } @@ -78,4 +78,4 @@ class PermissionsTest extends FeatureTestCase 'description' => $this->faker->text(5), ]; } -} \ No newline at end of file +} diff --git a/tests/Feature/Auth/RolesTest.php b/tests/Feature/Auth/RolesTest.php index d2a96ff78..9ed17f379 100644 --- a/tests/Feature/Auth/RolesTest.php +++ b/tests/Feature/Auth/RolesTest.php @@ -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); } @@ -79,4 +79,4 @@ class RolesTest extends FeatureTestCase 'permissions' => Permission::take(10)->pluck('id')->toArray(), ]; } -} \ No newline at end of file +} diff --git a/tests/Feature/Auth/UsersTest.php b/tests/Feature/Auth/UsersTest.php index eb3c14a73..29ff8140b 100644 --- a/tests/Feature/Auth/UsersTest.php +++ b/tests/Feature/Auth/UsersTest.php @@ -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); } diff --git a/tests/Feature/Banking/AccountsTest.php b/tests/Feature/Banking/AccountsTest.php index 7146a6e59..912d7ffb1 100644 --- a/tests/Feature/Banking/AccountsTest.php +++ b/tests/Feature/Banking/AccountsTest.php @@ -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'); diff --git a/tests/Feature/Banking/ReconciliationsTest.php b/tests/Feature/Banking/ReconciliationsTest.php index 2f2f0e17c..ae94d55bd 100644 --- a/tests/Feature/Banking/ReconciliationsTest.php +++ b/tests/Feature/Banking/ReconciliationsTest.php @@ -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'); diff --git a/tests/Feature/Banking/TransfersTest.php b/tests/Feature/Banking/TransfersTest.php index e98193809..4e5c3c0ba 100644 --- a/tests/Feature/Banking/TransfersTest.php +++ b/tests/Feature/Banking/TransfersTest.php @@ -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'); diff --git a/tests/Feature/Common/ItemsTest.php b/tests/Feature/Common/ItemsTest.php index 69ec4e6cc..9a93396cd 100644 --- a/tests/Feature/Common/ItemsTest.php +++ b/tests/Feature/Common/ItemsTest.php @@ -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'); diff --git a/tests/Feature/Purchases/BillsTest.php b/tests/Feature/Purchases/BillsTest.php index 3bff7059b..20acda1ec 100644 --- a/tests/Feature/Purchases/BillsTest.php +++ b/tests/Feature/Purchases/BillsTest.php @@ -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); } diff --git a/tests/Feature/Purchases/PaymentsTest.php b/tests/Feature/Purchases/PaymentsTest.php index e7da26a83..65cf55fea 100644 --- a/tests/Feature/Purchases/PaymentsTest.php +++ b/tests/Feature/Purchases/PaymentsTest.php @@ -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(); diff --git a/tests/Feature/Purchases/VendorsTest.php b/tests/Feature/Purchases/VendorsTest.php index c76cb4eef..d42ea6fe9 100644 --- a/tests/Feature/Purchases/VendorsTest.php +++ b/tests/Feature/Purchases/VendorsTest.php @@ -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() diff --git a/tests/Feature/Sales/CustomersTest.php b/tests/Feature/Sales/CustomersTest.php index 879b5ec27..633f7d1fd 100644 --- a/tests/Feature/Sales/CustomersTest.php +++ b/tests/Feature/Sales/CustomersTest.php @@ -24,7 +24,7 @@ class CustomersTest extends FeatureTestCase ->assertStatus(200) ->assertSeeText(trans('general.title.new', ['type' => trans_choice('general.customers', 1)])); } - + public function testItShouldCreateOnlyCustomerWithoutUser() { $this->loginAs() @@ -45,7 +45,7 @@ class CustomersTest extends FeatureTestCase $this->assertFlashLevel('success'); $user = User::where('email', $customer['email'])->first(); - + $this->assertNotNull($user); $this->assertEquals($customer['email'], $user->email); } @@ -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() @@ -93,7 +92,7 @@ class CustomersTest extends FeatureTestCase $this->loginAs() ->delete(route('customers.destroy', $customer->id)) ->assertStatus(200); - + $this->assertFlashLevel('success'); } diff --git a/tests/Feature/Sales/InvoicesTest.php b/tests/Feature/Sales/InvoicesTest.php index 8739f1577..7a0efdf48 100644 --- a/tests/Feature/Sales/InvoicesTest.php +++ b/tests/Feature/Sales/InvoicesTest.php @@ -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); } diff --git a/tests/Feature/Sales/RevenuesTest.php b/tests/Feature/Sales/RevenuesTest.php index b04b00432..23c93d63e 100644 --- a/tests/Feature/Sales/RevenuesTest.php +++ b/tests/Feature/Sales/RevenuesTest.php @@ -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(); diff --git a/tests/Feature/Settings/CategoriesTest.php b/tests/Feature/Settings/CategoriesTest.php index 08f0110cd..86c62356c 100644 --- a/tests/Feature/Settings/CategoriesTest.php +++ b/tests/Feature/Settings/CategoriesTest.php @@ -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); } diff --git a/tests/Feature/Settings/CurrenciesTest.php b/tests/Feature/Settings/CurrenciesTest.php index 59b883f8a..9af563613 100644 --- a/tests/Feature/Settings/CurrenciesTest.php +++ b/tests/Feature/Settings/CurrenciesTest.php @@ -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(); diff --git a/tests/Feature/Settings/TaxesTest.php b/tests/Feature/Settings/TaxesTest.php index 605151479..ea8ebf2f7 100644 --- a/tests/Feature/Settings/TaxesTest.php +++ b/tests/Feature/Settings/TaxesTest.php @@ -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();