- Refactor WorkspacePolicy to use pivot role instead of workspace.user_id - Add manageBilling policy (owner only) to BillingController - Fix ApiKeyController authorization (view → manageTeam for store/destroy) - Fix WorkspaceInviteController using workspace.user_id for owner checks - Fix WorkspaceController settings is_owner using workspace.user_id - Create PostAction enum for UpdatePost/PostController action strings - Create ApiToken\Status enum - Add User::SUBSCRIPTION_NAME constant, replace all hardcoded 'default' - Convert wantsEmailFor to accept NotificationType enum - Convert all $data[] to data_get() across publishers, controllers, jobs - Fix SocialLoginController callback missing try/catch - Fix SocialController::toggleActive missing workspace null check - Fix UpdatePost NPE on meta merge when postPlatform not found - Remove HTML5 required attributes from form inputs - Convert function declarations to arrow functions in Vue components - Replace hardcoded URLs with Wayfinder route helpers - Replace new Date() with dayjs - Add 16 new test files covering policies, authorization, publishing
37 lines
1,021 B
PHP
37 lines
1,021 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\User;
|
|
|
|
test('signup success page requires authentication', function () {
|
|
$response = $this->get(route('register.success'));
|
|
|
|
$response->assertRedirect(route('login'));
|
|
});
|
|
|
|
test('signup success page renders with default email provider', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get(route('register.success'));
|
|
|
|
$response->assertOk();
|
|
$response->assertInertia(fn ($page) => $page
|
|
->component('auth/SignupSuccess')
|
|
->where('authProvider', 'email')
|
|
);
|
|
});
|
|
|
|
test('signup success page renders with google provider from session', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)
|
|
->withSession(['auth_provider' => 'google'])
|
|
->get(route('register.success'));
|
|
|
|
$response->assertOk();
|
|
$response->assertInertia(fn ($page) => $page
|
|
->component('auth/SignupSuccess')
|
|
->where('authProvider', 'google')
|
|
);
|
|
});
|