Updated various classes and tests.

This commit is contained in:
James Cole
2014-07-02 23:31:59 +02:00
parent 063cf14531
commit 757e076a83
7 changed files with 190 additions and 94 deletions

View File

@@ -30,6 +30,17 @@ class UserControllerTest extends TestCase
$data = ['email' => 'bla@bla.nl', 'password' => 'xxxx','remember_me' => '1'];
Auth::shouldReceive('attempt')->once()->andReturn(true);
$this->call('POST', '/login', $data);
$this->assertSessionHas('success');
$this->assertRedirectedToRoute('index');
}
public function testPostFalseLogin()
{
$data = ['email' => 'bla@bla.nl', 'password' => 'xxxx','remember_me' => '1'];
Auth::shouldReceive('attempt')->once()->andReturn(false);
View::shouldReceive('make')->with('user.login')->once();
$this->call('POST', '/login', $data);
$this->assertSessionHas('error');
}
public function tearDown()