From 15cd91c71a57a0b84af620181a64b26d5aec8237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Mon, 15 Oct 2018 12:17:21 +0200 Subject: Make all legacy security reports to use raw format - This introduces and uses `:raw` format for all legacy reports, the ones that do not have yet proper parsers on Backend - Raw format is needed to make Frontend be able to parse reports, without the need of decompressing, - This also extends fixtures to seed security reports with database, even though parser code is part of EE --- spec/presenters/ci/build_runner_presenter_spec.rb | 32 ++++++++++++----------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'spec/presenters') diff --git a/spec/presenters/ci/build_runner_presenter_spec.rb b/spec/presenters/ci/build_runner_presenter_spec.rb index a42d1f3d399..170e0ac5717 100644 --- a/spec/presenters/ci/build_runner_presenter_spec.rb +++ b/spec/presenters/ci/build_runner_presenter_spec.rb @@ -40,21 +40,23 @@ describe Ci::BuildRunnerPresenter do context "with reports" do Ci::JobArtifact::DEFAULT_FILE_NAMES.each do |file_type, filename| - let(:report) { { "#{file_type}": [filename] } } - let(:build) { create(:ci_build, options: { artifacts: { reports: report } } ) } - - let(:report_expectation) do - { - name: filename, - artifact_type: :"#{file_type}", - artifact_format: :gzip, - paths: [filename], - when: 'always' - } - end - - it 'presents correct hash' do - expect(presenter.artifacts.first).to include(report_expectation) + context file_type.to_s do + let(:report) { { "#{file_type}": [filename] } } + let(:build) { create(:ci_build, options: { artifacts: { reports: report } } ) } + + let(:report_expectation) do + { + name: filename, + artifact_type: :"#{file_type}", + artifact_format: Ci::JobArtifact::TYPE_AND_FORMAT_PAIRS.fetch(file_type), + paths: [filename], + when: 'always' + } + end + + it 'presents correct hash' do + expect(presenter.artifacts.first).to include(report_expectation) + end end end end -- cgit v1.2.1