diff options
author | Maxim Rydkin <maks.rydkin@gmail.com> | 2017-09-06 14:11:00 +0300 |
---|---|---|
committer | Maxim Rydkin <maks.rydkin@gmail.com> | 2017-09-12 22:32:01 +0300 |
commit | f364cc34ea7562e782964b2c65428055d525e440 (patch) | |
tree | 8f2c86360b5beb1066c1c541419ceeead5de0e0a /spec/lib/gitlab/ci/charts_spec.rb | |
parent | 060fc3905de795ff206260b97afd18177f876316 (diff) | |
download | gitlab-ce-f364cc34ea7562e782964b2c65428055d525e440.tar.gz |
move `lib/ci/charts.rb` into `lib/gitlab/ci/charts.rb`
Diffstat (limited to 'spec/lib/gitlab/ci/charts_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/charts_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/charts_spec.rb b/spec/lib/gitlab/ci/charts_spec.rb new file mode 100644 index 00000000000..f8188675013 --- /dev/null +++ b/spec/lib/gitlab/ci/charts_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +describe Gitlab::Ci::Charts do + context "pipeline_times" do + let(:project) { create(:project) } + let(:chart) { Gitlab::Ci::Charts::PipelineTime.new(project) } + + subject { chart.pipeline_times } + + before do + create(:ci_empty_pipeline, project: project, duration: 120) + end + + it 'returns pipeline times in minutes' do + is_expected.to contain_exactly(2) + end + + it 'handles nil pipeline times' do + create(:ci_empty_pipeline, project: project, duration: nil) + + is_expected.to contain_exactly(2, 0) + end + end +end |