From 0cbb50ae9d7cffe13bfa5d3bbb15d4a57c3ed331 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 31 Dec 2014 07:17:33 +0100 Subject: [PATCH] Full coverage for user controller. --- app/controllers/UserController.php | 18 ++++-------------- tests/functional/UserControllerCest.php | 2 +- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/app/controllers/UserController.php b/app/controllers/UserController.php index 00840fb375..e1d3c29311 100644 --- a/app/controllers/UserController.php +++ b/app/controllers/UserController.php @@ -79,14 +79,9 @@ class UserController extends BaseController //$user = $this->user->register(Input::all()); if ($user) { - if (Config::get('auth.verify_mail') === true) { - $email->sendVerificationMail($user); + $email->sendVerificationMail($user); - return View::make('user.verification-pending'); - } - $email->sendPasswordMail($user); - - return View::make('user.registered'); + return View::make('user.verification-pending'); } @@ -115,14 +110,9 @@ class UserController extends BaseController return View::make('user.remindme'); } - if (Config::get('auth.verify_reset') === true) { - $email->sendResetVerification($user); + $email->sendResetVerification($user); - return View::make('user.verification-pending'); - } - $email->sendPasswordMail($user); - - return View::make('user.registered'); + return View::make('user.verification-pending'); } diff --git a/tests/functional/UserControllerCest.php b/tests/functional/UserControllerCest.php index 62d58c9833..53281b5536 100644 --- a/tests/functional/UserControllerCest.php +++ b/tests/functional/UserControllerCest.php @@ -68,7 +68,7 @@ class UserControllerCest $I->wantTo('post-register a new account'); $I->amOnPage('/register'); $I->submitForm('#register', ['email' => 'noreply@gmail.com']); - $I->see('Password sent!'); + $I->see('You\'re about to get an e-mail. Please follow its instructions.'); $I->seeRecord('users', ['email' => 'noreply@gmail.com']); }