From 890e8e152ba95ee1c64b84b7c730f115ef99be5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Drunen?= Date: Mon, 24 Aug 2020 18:34:01 +0200 Subject: [PATCH] Test user deletion using Dusk --- .env.travis | 2 +- tests/Browser/DeleteUserTest.php | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tests/Browser/DeleteUserTest.php diff --git a/.env.travis b/.env.travis index 91146cde..e30e48e3 100644 --- a/.env.travis +++ b/.env.travis @@ -5,7 +5,7 @@ APP_DEBUG=true APP_LOG_LEVEL=debug APP_URL=http://localhost:8000 -DB_CONNECTION=mysql +DB_CONNECTION=testing DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=budget diff --git a/tests/Browser/DeleteUserTest.php b/tests/Browser/DeleteUserTest.php new file mode 100644 index 00000000..d87658a1 --- /dev/null +++ b/tests/Browser/DeleteUserTest.php @@ -0,0 +1,35 @@ +create([ + 'password' => Hash::make($password) + ]); + + $this->browse(function (Browser $browser) use ($user, $password) { + $browser + ->assertGuest() + ->visit('/login') + ->type('email', $user->email) + ->type('password', $password) + ->press('Log in') + ->assertAuthenticated() + ->visit('/settings/account') + ->press('Delete') + ->press('Yes, I am sure') + ->assertGuest(); + }); + } +}