diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-26 11:47:30 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-26 11:47:30 +0200 |
commit | f19e259fb816bcaaeab9720d8b277b12b766698e (patch) | |
tree | 82a9b742d1ee4cafcbfca096f2affcd615b6f03d /spec/models/ci | |
parent | d8aed6a27bc6e5e5cd14a10219473c34ba424949 (diff) | |
download | gitlab-ce-f19e259fb816bcaaeab9720d8b277b12b766698e.tar.gz |
Fix duration specs
Diffstat (limited to 'spec/models/ci')
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index e13cd8c1dd0..5eb14dc6bd2 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -144,31 +144,24 @@ describe Ci::Pipeline, models: true do describe '#duration' do before do - pipeline.update(created_at: current) - - travel_to(current + 5) do - pipeline.run - pipeline.save - end - travel_to(current + 30) do - build.success + build.run! + build.success! + build_b.run! + build_c.run! end travel_to(current + 40) do - build_b.drop + build_b.drop! end travel_to(current + 70) do - build_c.success + build_c.success! end - - # We have to reload pipeline, because its status is updated by processing builds - pipeline.reload.drop end it 'matches sum of builds duration' do - binding.pry + pipeline.reload expect(pipeline.duration).to eq(40) end |