public function testConnectFailsToConnectNewAccount() { RemoteUser::shouldReceive('connect')->once()->andThrow(new RestGalleries\Exception\AuthException('Invalid credentials')); $this->call('POST', 'users'); $this->assertRedirectedTo('users'); $this->assertSessionHas('message', 'Invalid credentials'); }