summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2017-10-05 15:14:44 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2017-10-05 15:14:44 +0200
commitd1dd115356a06fd20e8b9293cd645bb064b7c56a (patch)
tree089d4a705176a79e633adf93f24b04b1ec186979
parente4d07f12b65fa8d1753a950a79c985406614c2b1 (diff)
downloadgitlab-ce-d1dd115356a06fd20e8b9293cd645bb064b7c56a.tar.gz
Update test to use the new API34102-online-view-of-artifacts-fe
-rw-r--r--spec/models/ci/artifact_blob_spec.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/models/ci/artifact_blob_spec.rb b/spec/models/ci/artifact_blob_spec.rb
index 81500fce6f9..d5ba088af53 100644
--- a/spec/models/ci/artifact_blob_spec.rb
+++ b/spec/models/ci/artifact_blob_spec.rb
@@ -1,7 +1,8 @@
require 'spec_helper'
describe Ci::ArtifactBlob do
- set(:build) { create(:ci_build, :artifacts) }
+ set(:project) { create(:project, :public) }
+ set(:build) { create(:ci_build, :artifacts, project: project) }
let(:entry) { build.artifacts_metadata_entry('other_artifacts_0.1.2/another-subdirectory/banana_sample.gif') }
subject { described_class.new(entry) }
@@ -74,12 +75,18 @@ describe Ci::ArtifactBlob do
allow(Gitlab.config.pages).to receive(:artifacts_server).and_return(true)
end
- it { is_expected.not_to be_external_link }
+ context 'gif extensions' do
+ it 'returns false' do
+ expect(subject.external_link?(build)).to be false
+ end
+ end
context 'txt extensions' do
let(:entry) { build.artifacts_metadata_entry('other_artifacts_0.1.2/doc_sample.txt') }
- it { is_expected.to be_external_link }
+ it 'returns true' do
+ expect(subject.external_link?(build)).to be true
+ end
end
end
end