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

25 lines
569 B
Ruby
Raw Normal View History

2015-08-25 21:42:46 -04:00
require 'spec_helper'
describe Ci::Charts do
context "pipeline_times" do
let(:project) { create(:empty_project) }
let(:chart) { Ci::Charts::PipelineTime.new(project) }
subject { chart.pipeline_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 pipeline times in minutes' do
is_expected.to contain_exactly(2)
2015-08-25 21:42:46 -04:00
end
it 'handles nil pipeline 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