be($this->user());
$this->call('get', route('profile.change-password'));
$this->assertResponseStatus(200);
$this->see('
');
}
/**
* @covers \FireflyIII\Http\Controllers\ProfileController::deleteAccount
*/
public function testDeleteAccount()
{
$this->be($this->user());
$this->call('get', route('profile.delete-account'));
$this->assertResponseStatus(200);
$this->see('');
}
/**
* @covers \FireflyIII\Http\Controllers\ProfileController::index
*/
public function testIndex()
{
$this->be($this->user());
$this->call('get', route('profile.index'));
$this->assertResponseStatus(200);
$this->see('');
}
/**
* @covers \FireflyIII\Http\Controllers\ProfileController::postChangePassword
*/
public function testPostChangePassword()
{
$repository = $this->mock(UserRepositoryInterface::class);
$repository->shouldReceive('changePassword');
$data = [
'current_password' => 'james',
'new_password' => 'james2',
'new_password_confirmation' => 'james2',
];
$this->be($this->user());
$this->call('post', route('profile.change-password.post'), $data);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
}
/**
* @covers \FireflyIII\Http\Controllers\ProfileController::postDeleteAccount
*/
public function testPostDeleteAccount()
{
$repository = $this->mock(UserRepositoryInterface::class);
$repository->shouldReceive('destroy');
$data = [
'password' => 'james',
];
$this->be($this->user());
$this->call('post', route('profile.delete-account.post'), $data);
$this->assertResponseStatus(302);
$this->assertRedirectedToRoute('index');
}
}