diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-01-05 13:05:44 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-01-14 12:48:15 +0100 |
commit | cfffc9eff2c394259000090fb8c4c116863c9199 (patch) | |
tree | 139518e4e1ff694054b09d468b0bcf1f99bd94c8 | |
parent | e5d2a81b86d59c50ff5c488da017a9b56d0442f0 (diff) | |
download | gitlab-ce-cfffc9eff2c394259000090fb8c4c116863c9199.tar.gz |
Update build specs for artifacts browser support
-rw-r--r-- | spec/models/build_spec.rb | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb index 108d7d5ff01..ca96e827e04 100644 --- a/spec/models/build_spec.rb +++ b/spec/models/build_spec.rb @@ -394,21 +394,20 @@ describe Ci::Build, models: true do describe :artifacts_browser_supported? do subject { build.artifacts_browser_supported? } - before do - file = fixture_file_upload(archive_file, archive_type) - build.update_attributes(artifacts_file: file) - end - - context 'artifacts archive is not a zip file' do - let(:archive_file) { Rails.root + 'spec/fixtures/banana_sample.gif' } - let(:archive_type) { 'image/gif' } - + context 'artifacts metadata does not exist' do it { is_expected.to be_falsy } end - context 'artifacts archive is a zip file' do - let(:archive_file) { Rails.root + 'spec/fixtures/ci_build_artifacts.zip' } - let(:archive_type) { 'application/zip' } + context 'artifacts archive is a zip file and metadata exists' do + before do + fixture_dir = Rails.root + 'spec/fixtures/' + archive = fixture_file_upload(fixture_dir + 'ci_build_artifacts.zip', + 'application/zip') + metadata = fixture_file_upload(fixture_dir + 'ci_build_artifacts_metadata.gz', + 'application/x-gzip') + build.update_attributes(artifacts_file: archive) + build.update_attributes(artifacts_metadata: metadata) + end it { is_expected.to be_truthy } end |