Fix integration tests to properly account for the rule position in the API

This commit is contained in:
Dane Everitt 2020-08-27 21:19:01 -07:00
parent f293c73977
commit 1e19e02398
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
9 changed files with 14 additions and 13 deletions

View file

@ -66,7 +66,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase
'time_offset' => 0,
])
->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY)
->assertJsonPath('errors.0.code', 'in')
->assertJsonPath('errors.0.meta.rule', 'in')
->assertJsonPath('errors.0.source.field', 'action');
$this->actingAs($user)->postJson($this->link($schedule, '/tasks'), [
@ -74,7 +74,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase
'time_offset' => 0,
])
->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY)
->assertJsonPath('errors.0.code', 'required_unless')
->assertJsonPath('errors.0.meta.rule', 'required_unless')
->assertJsonPath('errors.0.source.field', 'payload');
$this->actingAs($user)->postJson($this->link($schedule, '/tasks'), [
@ -84,7 +84,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase
'sequence_id' => 'hodor',
])
->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY)
->assertJsonPath('errors.0.code', 'numeric')
->assertJsonPath('errors.0.meta.rule', 'numeric')
->assertJsonPath('errors.0.source.field', 'sequence_id');
}