diff options
Diffstat (limited to 'spec/models/ci/build_report_result_spec.rb')
-rw-r--r-- | spec/models/ci/build_report_result_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/ci/build_report_result_spec.rb b/spec/models/ci/build_report_result_spec.rb index 90b23d3e824..90426f60c73 100644 --- a/spec/models/ci/build_report_result_spec.rb +++ b/spec/models/ci/build_report_result_spec.rb @@ -33,6 +33,19 @@ RSpec.describe Ci::BuildReportResult do expect(build_report_result.errors.full_messages).to eq(["Data must be a valid json schema"]) end end + + context 'when data tests is invalid' do + it 'returns errors' do + build_report_result.data = { + 'tests' => { + 'invalid' => 'invalid' + } + } + + expect(build_report_result).to be_invalid + expect(build_report_result.errors.full_messages).to eq(["Data must be a valid json schema"]) + end + end end describe '#tests_name' do |