fix(projects): Plan 5 Task 3 code-review fixes (2 Important + 2 Minor)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,7 @@ it('creates a site project with valid payload', function () {
|
||||
]);
|
||||
|
||||
$response->assertCreated();
|
||||
$response->assertJsonPath('data.sync_status', 'pending');
|
||||
expect(Project::where('signal_identifier', 'okna-spb.ru')->exists())->toBeTrue();
|
||||
Queue::assertPushed(SyncSupplierProjectJob::class);
|
||||
});
|
||||
@@ -129,3 +130,17 @@ it('forces tenant_id from auth user (not from payload)', function () {
|
||||
$project = Project::where('signal_identifier', 'x.ru')->latest()->first();
|
||||
expect($project->tenant_id)->toBe($tenantA->id);
|
||||
});
|
||||
|
||||
it('rejects site domain with consecutive dots', function () {
|
||||
$tenant = Tenant::factory()->create();
|
||||
$user = User::factory()->create(['tenant_id' => $tenant->id]);
|
||||
|
||||
$response = $this->actingAs($user)->postJson('/api/projects', [
|
||||
'name' => 'X', 'signal_type' => 'site', 'signal_identifier' => 'okna..spb.ru',
|
||||
'daily_limit_target' => 50, 'region_mask' => 0, 'region_mode' => 'include',
|
||||
'delivery_days_mask' => 127,
|
||||
]);
|
||||
|
||||
$response->assertStatus(422);
|
||||
$response->assertJsonValidationErrors(['signal_identifier']);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user