/** * @test */ public function shouldRedirectToIndexOnSuccessInCreate() { //when $this->post('/users', array('user' => array('login' => 'login'))); //then $this->assertRedirectsTo(usersPath()); }
public function create() { $user = new User($this->params['user']); if ($user->isValid()) { $user->insert(); $this->redirect(usersPath(), "User added"); } else { $this->view->user = $user; $this->view->render('Users/fresh'); } }