mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-12 16:44:08 -08:00
Simplify assertions
This commit is contained in:
parent
1d89759706
commit
a2246b9645
|
@ -90,13 +90,10 @@ class UpdateAssetModelsTest extends TestCase
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEquals(
|
$potentiallyChangedDefaultValues = $assetModel->defaultValues->pluck('pivot.default_value');
|
||||||
2,
|
$this->assertCount(2, $potentiallyChangedDefaultValues);
|
||||||
$assetModel->fresh()->defaultValues->filter(function (CustomField $field) {
|
$this->assertContains('first default value', $potentiallyChangedDefaultValues);
|
||||||
return in_array($field->pivot->default_value, ['first default value', 'second default value']);
|
$this->assertContains('second default value', $potentiallyChangedDefaultValues);
|
||||||
})->count(),
|
|
||||||
'Default field values were changed unexpectedly.'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_default_values_can_be_updated()
|
public function test_default_values_can_be_updated()
|
||||||
|
@ -129,7 +126,6 @@ class UpdateAssetModelsTest extends TestCase
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$potentiallyChangedDefaultValues = $assetModel->defaultValues->pluck('pivot.default_value');
|
$potentiallyChangedDefaultValues = $assetModel->defaultValues->pluck('pivot.default_value');
|
||||||
|
|
||||||
$this->assertCount(2, $potentiallyChangedDefaultValues);
|
$this->assertCount(2, $potentiallyChangedDefaultValues);
|
||||||
$this->assertContains('first changed value', $potentiallyChangedDefaultValues);
|
$this->assertContains('first changed value', $potentiallyChangedDefaultValues);
|
||||||
$this->assertContains('second changed value', $potentiallyChangedDefaultValues);
|
$this->assertContains('second changed value', $potentiallyChangedDefaultValues);
|
||||||
|
|
Loading…
Reference in a new issue