Welcome to mirror list, hosted at ThFree Co, Russian Federation.

charts_spec.rb « ci « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 97f2e97b062711776540b709949b38c6372c9b9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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