X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/07bc0612c0d276d8d9fb234f570556f655afdf04..refs/pull/1881/head:/tests/Auth/SocialAuthTest.php diff --git a/tests/Auth/SocialAuthTest.php b/tests/Auth/SocialAuthTest.php index 5bfe0c222..526c0e199 100644 --- a/tests/Auth/SocialAuthTest.php +++ b/tests/Auth/SocialAuthTest.php @@ -6,7 +6,7 @@ class SocialAuthTest extends TestCase 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']); @@ -86,7 +86,7 @@ class SocialAuthTest extends TestCase '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'); @@ -125,7 +125,7 @@ class SocialAuthTest extends TestCase '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'); @@ -148,4 +148,12 @@ class SocialAuthTest extends TestCase $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')); + } + }