Skip to content

Commit

Permalink
Test the combination of errors from different validators
Browse files Browse the repository at this point in the history
  • Loading branch information
saraycp committed Sep 10, 2021
1 parent f7e75f4 commit dbdbc7b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/api/spec/models/workflow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,24 @@
)
end
end

context 'with a combination of invalid filters and invalid steps' do
let(:yaml) do
{
'filters' => {
'unsupported_1' => { 'only' => ['foo'] }
},
'steps' => [{ 'branch_package' => { source_project: nil,
source_package: 'package' },
'unsuported_step_1' => { source_project: 'project' } }]
}
end

it 'sets validation errors' do
expect(subject.errors.full_messages).to match_array(
["Invalid workflow step definition: unsuported_step_1 is not a supported step and Source project name can't be blank", 'Unsupported filters: unsupported_1']
)
end
end
end
end

0 comments on commit dbdbc7b

Please sign in to comment.