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: 2be50edc347f1e95d0d60ccbcc5d4702d924f64a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'spec_helper'

describe Ci::Charts, lib: true do

  context "build_times" do
    before do
      @commit = FactoryGirl.create(:ci_commit)
      FactoryGirl.create(:ci_build, pipeline: @commit)
    end

    it 'should return build times in minutes' do
      chart = Ci::Charts::BuildTime.new(@commit.project)
      expect(chart.build_times).to eq([2])
    end

    it 'should handle nil build times' do
      create(:ci_commit, duration: nil, project: @commit.project)

      chart = Ci::Charts::BuildTime.new(@commit.project)
      expect(chart.build_times).to eq([2, 0])
    end
  end
end