Commit f80d7a86 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Update build model specs

parent 94cf7590
...@@ -361,14 +361,13 @@ describe Ci::Build, models: true do ...@@ -361,14 +361,13 @@ describe Ci::Build, models: true do
describe :artifacts_browse_url do describe :artifacts_browse_url do
subject { build.artifacts_browse_url } subject { build.artifacts_browse_url }
it "should be nil if artifact doesn't exist" do it "should be nil if artifacts browser is unsupported" do
build.update_attributes(artifacts_file: nil) allow(build).to receive(:artifacts_browser_supported?).and_return(false)
is_expected.to be_nil is_expected.to be_nil
end end
it 'should not be nil if artifact exist' do it 'should not be nil if artifacts browser is supported' do
gif = fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif') allow(build).to receive(:artifacts_browser_supported?).and_return(true)
build.update_attributes(artifacts_file: gif)
is_expected.to_not be_nil is_expected.to_not be_nil
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