Features: - Implement two fee types: entrance fee and annual fee (both NT$1,000) - Add 50% discount for disability certificate holders - Add disability certificate upload in member profile - Integrate disability verification into cashier approval workflow - Add membership fee settings in system admin Document permissions: - Fix hard-coded role logic in Document model - Use permission-based authorization instead of role checks Additional features: - Add announcements, general ledger, and trial balance modules - Add income management and accounting entries - Add comprehensive test suite with factories - Update UI translations to Traditional Chinese 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature\Auth;
|
|
|
|
use App\Http\Middleware\VerifyCsrfToken;
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
class PasswordConfirmationTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_confirm_password_screen_can_be_rendered(): void
|
|
{
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get('/confirm-password');
|
|
|
|
$response->assertStatus(200);
|
|
}
|
|
|
|
public function test_password_can_be_confirmed(): void
|
|
{
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->withoutMiddleware(VerifyCsrfToken::class)
|
|
->actingAs($user)
|
|
->post('/confirm-password', [
|
|
'password' => 'password',
|
|
]);
|
|
|
|
$response->assertRedirect();
|
|
$response->assertSessionHasNoErrors();
|
|
}
|
|
|
|
public function test_password_is_not_confirmed_with_invalid_password(): void
|
|
{
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->withoutMiddleware(VerifyCsrfToken::class)
|
|
->actingAs($user)
|
|
->post('/confirm-password', [
|
|
'password' => 'wrong-password',
|
|
]);
|
|
|
|
$response->assertSessionHasErrors();
|
|
}
|
|
}
|