working on client test

This commit is contained in:
David Bomba 2019-03-26 22:31:07 +11:00
parent 6272fb36fc
commit 7defe077bc
2 changed files with 15 additions and 10 deletions

View File

@ -52,7 +52,7 @@ class LoginController extends Controller
*/ */
public function authenticated(Request $request, User $user) : void public function authenticated(Request $request, User $user) : void
{ {
$this->setCurrentCompanyId($user->companies()->first()->account->default_company_id); //$this->setCurrentCompanyId($user->companies()->first()->account->default_company_id);
} }
/** /**

View File

@ -27,25 +27,30 @@ class ClientTest extends TestCase
$faker = \Faker\Factory::create(); $faker = \Faker\Factory::create();
$data = [ $this->data = [
'first_name' => $faker->firstName, 'first_name' => $faker->firstName,
'last_name' => $faker->lastName, 'last_name' => $faker->lastName,
'email' => $faker->unique()->safeEmail, 'email' => $faker->unique()->safeEmail,
'password' => 'ALongAndBrilliantPassword123' 'password' => 'ALongAndBrilliantPassword123',
'_token' => csrf_token()
]; ];
$this->user = CreateAccount::dispatchNow($data); // $this->user = CreateAccount::dispatchNow($data);
} }
public function testAccountCreation()
{
$response = $this->post('/signup', $this->data);
$this->assertEquals($response->json(), 'yadda');
//$response->assertSuccessful();
//$response->assertStatus(200);
}
/**
* A valid user can be logged in.
*
* @return void
*/
public function testUserCreated() public function testUserCreated()
{ {
$this->assertTrue($user); $this->assertTrue(true);
} }