gitlab-org--gitlab-foss/spec/lib/ci/charts_spec.rb

25 lines
565 B
Ruby
Raw Normal View History

2015-08-25 21:42:46 -04:00
require 'spec_helper'
2015-12-09 05:55:36 -05:00
describe Ci::Charts, lib: true do
2015-08-25 21:42:46 -04:00
context "build_times" do
let(:project) { create(:empty_project) }
let(:chart) { Ci::Charts::BuildTime.new(project) }
subject { chart.build_times }
2015-08-25 21:42:46 -04:00
before do
create(:ci_empty_pipeline, project: project, duration: 120)
2015-08-25 21:42:46 -04:00
end
it 'returns build times in minutes' do
is_expected.to contain_exactly(2)
2015-08-25 21:42:46 -04:00
end
it 'handles nil build times' do
create(:ci_empty_pipeline, project: project, duration: nil)
is_expected.to contain_exactly(2, 0)
end
2015-08-25 21:42:46 -04:00
end
end