<?php

declare(strict_types=1);

namespace Tests\Feature\Account;

use Tests\DatabaseTestCase;

class FeatureGateTest extends DatabaseTestCase
{
    public function testReturns401WhenFeatureDisabled(): void
    {
        $response = $this->asTenant(tenant())->postJson(route('account.register'), [
            'first_name' => 'Ada',
            'last_name' => 'Lovelace',
            'email' => 'ada@example.com',
            'password' => 'correct-horse-battery',
            'password_confirmation' => 'correct-horse-battery',
        ]);

        $response->assertStatus(401);
    }

    public function testMeReturns401WhenFeatureDisabled(): void
    {
        $response = $this->asTenant(tenant())->getJson(route('account.me'));
        $response->assertStatus(401);
    }
}
