blob: 9c6b4ea50861f095b1837bd2797abd656467b67a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
require 'spec_helper'
describe Ci::Charts, lib: true do
context "build_times" do
before do
@pipeline = FactoryGirl.create(:ci_pipeline)
FactoryGirl.create(:ci_build, pipeline: @pipeline)
end
it 'should return build times in minutes' do
chart = Ci::Charts::BuildTime.new(@pipeline.project)
expect(chart.build_times).to eq([2])
end
it 'should handle nil build times' do
create(:ci_pipeline, duration: nil, project: @pipeline.project)
chart = Ci::Charts::BuildTime.new(@pipeline.project)
expect(chart.build_times).to eq([2, 0])
end
end
end
|