feat: implement product attributes and tenant properties management with CRUD controllers, requests, and domain models
This commit is contained in:
@@ -42,11 +42,11 @@ class ProductAttributeControllerTest extends TestCase
|
||||
|
||||
$response
|
||||
->assertCreated()
|
||||
->assertJsonPath('tenant_codigo', 'acme')
|
||||
->assertJsonPath('codigo', 'color')
|
||||
->assertJsonPath('type', 'select')
|
||||
->assertJsonPath('options.0.label', 'Red')
|
||||
->assertJsonPath('options.1.metadata.hex', '#0000ff');
|
||||
->assertJsonPath('data.tenant_codigo', 'acme')
|
||||
->assertJsonPath('data.codigo', 'color')
|
||||
->assertJsonPath('data.type', 'select')
|
||||
->assertJsonPath('data.options.0.label', 'Red')
|
||||
->assertJsonPath('data.options.1.metadata.hex', '#0000ff');
|
||||
|
||||
$this->assertDatabaseHas('productos_attributes', [
|
||||
'tenant_codigo' => 'acme',
|
||||
@@ -60,7 +60,7 @@ class ProductAttributeControllerTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_it_rejects_options_for_text_attributes(): void
|
||||
public function test_it_rejects_options_for_string_attributes(): void
|
||||
{
|
||||
Tenant::create([
|
||||
'codigo' => 'acme',
|
||||
@@ -71,7 +71,7 @@ class ProductAttributeControllerTest extends TestCase
|
||||
$response = $this->postJson('/api/tenants/acme/product-attributes', [
|
||||
'codigo' => 'material',
|
||||
'nombre' => 'Material',
|
||||
'type' => 'text',
|
||||
'type' => 'string',
|
||||
'options' => [
|
||||
['label' => 'Cotton'],
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user