debian-mirror-gitlab/spec/lib/ci/charts_spec.rb
2016-06-16 23:09:34 +05:30

23 lines
612 B
Ruby

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