BigW Consortium Gitlab

charts_spec.rb 565 Bytes
Newer Older
1 2
require 'spec_helper'

Douwe Maan committed
3
describe Ci::Charts, lib: true do
4
  context "build_times" do
5 6 7 8 9
    let(:project) { create(:empty_project) }
    let(:chart) { Ci::Charts::BuildTime.new(project) }

    subject { chart.build_times }

10
    before do
11
      create(:ci_empty_pipeline, project: project, duration: 120)
12 13
    end

14
    it 'returns build times in minutes' do
15
      is_expected.to contain_exactly(2)
16
    end
17

18
    it 'handles nil build times' do
19
      create(:ci_empty_pipeline, project: project, duration: nil)
20

21
      is_expected.to contain_exactly(2, 0)
22
    end
23 24
  end
end