debian-mirror-gitlab/spec/lib/ci/charts_spec.rb

24 lines
612 B
Ruby
Raw Normal View History

2015-09-25 12:07:36 +05:30
require 'spec_helper'
2015-12-23 02:04:40 +05:30
describe Ci::Charts, lib: true do
2015-09-25 12:07:36 +05:30
context "build_times" do
before do
@pipeline = FactoryGirl.create(:ci_pipeline)
FactoryGirl.create(:ci_build, pipeline: @pipeline)
2015-09-25 12:07:36 +05:30
end
it 'should return build times in minutes' do
chart = Ci::Charts::BuildTime.new(@pipeline.project)
2015-09-25 12:07:36 +05:30
expect(chart.build_times).to eq([2])
end
2016-06-02 11:05:42 +05:30
it 'should handle nil build times' do
create(:ci_pipeline, duration: nil, project: @pipeline.project)
2016-06-02 11:05:42 +05:30
chart = Ci::Charts::BuildTime.new(@pipeline.project)
2016-06-02 11:05:42 +05:30
expect(chart.build_times).to eq([2, 0])
end
2015-09-25 12:07:36 +05:30
end
end