public function test_social_registration()
{
// http://docs.mockery.io/en/latest/reference/startup_methods.html
- $user = factory(\BookStack\User::class)->make();
+ $user = factory(\BookStack\Auth\User::class)->make();
$this->setSettings(['registration-enabled' => 'true']);
config(['GOOGLE_APP_ID' => 'abc123', 'GOOGLE_APP_SECRET' => '123abc', 'APP_URL' => 'http://localhost']);
'APP_URL' => 'http://localhost'
]);
- $user = factory(\BookStack\User::class)->make();
+ $user = factory(\BookStack\Auth\User::class)->make();
$mockSocialite = \Mockery::mock('Laravel\Socialite\Contracts\Factory');
$this->app['Laravel\Socialite\Contracts\Factory'] = $mockSocialite;
$mockSocialDriver = \Mockery::mock('Laravel\Socialite\Contracts\Provider');
'APP_URL' => 'http://localhost', 'services.google.auto_register' => true, 'services.google.auto_confirm' => true
]);
- $user = factory(\BookStack\User::class)->make();
+ $user = factory(\BookStack\Auth\User::class)->make();
$mockSocialite = \Mockery::mock('Laravel\Socialite\Contracts\Factory');
$this->app['Laravel\Socialite\Contracts\Factory'] = $mockSocialite;
$mockSocialDriver = \Mockery::mock('Laravel\Socialite\Contracts\Provider');
$this->assertDatabaseHas('social_accounts', ['user_id' => $user->id]);
}
+ public function test_google_select_account_option_changes_redirect_url()
+ {
+ config()->set('services.google.select_account', 'true');
+
+ $resp = $this->get('/login/service/google');
+ $this->assertStringContainsString('prompt=select_account', $resp->headers->get('Location'));
+ }
+
}