Skip to content

Commit 55de131

Browse files
committed
add tests
1 parent 477d010 commit 55de131

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/Feature/AuthKitLoginRequestTest.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,30 @@
105105
->toContain('login_hint='.urlencode('[email protected]'));
106106
});
107107

108+
it('uses default redirect URL when not specified', function () {
109+
$response = $this->request->redirect();
110+
111+
expect($response->headers->get('Location'))
112+
->toContain('redirect_uri='.urlencode('https://laravel.com/authenticate'));
113+
});
114+
115+
it('uses custom redirect URL when specified', function () {
116+
$response = $this->request->redirect(['redirectUrl' => 'https://custom.laravel.com/authenticate']);
117+
118+
expect($response->headers->get('Location'))
119+
->toContain('redirect_uri='.urlencode('https://custom.laravel.com/authenticate'));
120+
});
121+
108122
it('supports multiple parameters at once', function () {
109123
$response = $this->request->redirect([
110124
'screenHint' => 'sign-in',
111125
'domainHint' => 'laravel.com',
112126
'loginHint' => '[email protected]',
127+
'redirectUrl' => 'https://custom.laravel.com/authenticate',
113128
]);
114129

115130
expect($response->headers->get('Location'))->toContain('screen_hint=sign-in')
116131
->toContain('domain_hint=laravel.com')
117-
->toContain('login_hint='.urlencode('[email protected]'));
132+
->toContain('login_hint='.urlencode('[email protected]'))
133+
->toContain('redirect_uri='.urlencode('https://custom.laravel.com/authenticate'));
118134
});

0 commit comments

Comments
 (0)