skipUnlessFortifyFeature(Features::registration()); } public function test_registration_screen_can_be_rendered() { $response = $this->get(route('register')); $response->assertOk(); } public function test_new_users_can_register() { Storage::fake('public'); $response = $this->post(route('register.store'), [ 'name' => 'Test User', 'email' => 'test@example.com', 'password' => 'password', 'password_confirmation' => 'password', ]); $this->assertAuthenticated(); $response->assertRedirect(route('dashboard', absolute: false)); $user = User::query()->where('email', 'test@example.com')->firstOrFail(); $this->assertTrue($user->avatar_is_generated); $this->assertNotNull($user->avatar_color); $this->assertNotNull($user->avatar_path); Storage::disk('public')->assertExists($user->avatar_path); $this->assertStringContainsString('TU', Storage::disk('public')->get($user->avatar_path)); } }