diff options
-rw-r--r-- | spec/models/build_spec.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb index ca96e827e04..0e13456723d 100644 --- a/spec/models/build_spec.rb +++ b/spec/models/build_spec.rb @@ -361,14 +361,13 @@ describe Ci::Build, models: true do describe :artifacts_browse_url do subject { build.artifacts_browse_url } - it "should be nil if artifact doesn't exist" do - build.update_attributes(artifacts_file: nil) + it "should be nil if artifacts browser is unsupported" do + allow(build).to receive(:artifacts_browser_supported?).and_return(false) is_expected.to be_nil end - it 'should not be nil if artifact exist' do - gif = fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif') - build.update_attributes(artifacts_file: gif) + it 'should not be nil if artifacts browser is supported' do + allow(build).to receive(:artifacts_browser_supported?).and_return(true) is_expected.to_not be_nil end end |