@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Tests\Feature\Auth;
|
||||
|
||||
use App\Models\Tenant;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Laravel\Fortify\Features;
|
||||
use Tests\TestCase;
|
||||
@@ -27,13 +28,24 @@ class RegistrationTest extends TestCase
|
||||
public function test_new_users_can_register()
|
||||
{
|
||||
$response = $this->post(route('register.store'), [
|
||||
'tenant_name' => 'ISP Test Network',
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
'password' => 'password',
|
||||
'password_confirmation' => 'password',
|
||||
'password' => 'Strong!Password123',
|
||||
'password_confirmation' => 'Strong!Password123',
|
||||
'deployment_type' => 'self_hosted',
|
||||
'deployment_domain' => 'ndm.test.example',
|
||||
]);
|
||||
|
||||
$this->assertAuthenticated();
|
||||
$response->assertRedirect(route('dashboard', absolute: false));
|
||||
$tenant = Tenant::where('slug', 'isp-test-network')->firstOrFail();
|
||||
$this->assertDatabaseHas('users', ['tenant_id' => $tenant->id, 'email' => 'test@example.com']);
|
||||
$this->assertDatabaseHas('deployment_installations', [
|
||||
'tenant_id' => $tenant->id,
|
||||
'deployment_type' => 'self_hosted',
|
||||
'domain' => 'ndm.test.example',
|
||||
'status' => 'pending',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user