Commit d1dd1153 authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Update test to use the new API

parent e4d07f12
require 'spec_helper' require 'spec_helper'
describe Ci::ArtifactBlob do 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') } let(:entry) { build.artifacts_metadata_entry('other_artifacts_0.1.2/another-subdirectory/banana_sample.gif') }
subject { described_class.new(entry) } subject { described_class.new(entry) }
...@@ -74,12 +75,18 @@ describe Ci::ArtifactBlob do ...@@ -74,12 +75,18 @@ describe Ci::ArtifactBlob do
allow(Gitlab.config.pages).to receive(:artifacts_server).and_return(true) allow(Gitlab.config.pages).to receive(:artifacts_server).and_return(true)
end 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 context 'txt extensions' do
let(:entry) { build.artifacts_metadata_entry('other_artifacts_0.1.2/doc_sample.txt') } 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 end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment