Added login error tests

This commit is contained in:
bretto36 2016-06-16 19:17:48 -04:00
parent 63f0f4ec1a
commit cbf7008e4e
2 changed files with 33 additions and 3 deletions

View File

@ -5,14 +5,14 @@ use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Attendize\Utils;
class UserTest extends TestCase
class UserLoginTest extends TestCase
{
/**
* Test login page is successful
*
* @return void
*/
public function testLogin()
public function test_login_is_successful()
{
$this->visit(route('login'))
->type($this->test_user_email, 'email')
@ -20,4 +20,34 @@ class UserTest extends TestCase
->press('Login')
->seePageIs(route('showCreateOrganiser', ['first_run' => '1']));
}
/**
* Test login page is unsuccessful with wrong password
*
* @return void
*/
public function test_login_is_unsuccessful_with_wrong_password()
{
$this->visit(route('login'))
->type($this->test_user_email, 'email')
->type('incorrect_password', 'password')
->press('Login')
->seePageIs(route('login'))
->see('Your username/password combination was incorrect');
}
/**
* Test login page is unsuccessful with wrong email address
*
* @return void
*/
public function test_login_is_unsuccessful_with_wrong_email_address()
{
$this->visit(route('login'))
->type('other@email.com', 'email')
->type($this->test_user_password, 'password')
->press('Login')
->seePageIs(route('login'))
->see('Your username/password combination was incorrect');
}
}

View File

@ -5,7 +5,7 @@ use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Attendize\Utils;
class UserTest extends TestCase
class UserSignUpTest extends TestCase
{
/**
* Test sign up page is successful