From f343acacf70c6c43f4f1d6a127fcd7f954a4b4e2 Mon Sep 17 00:00:00 2001 From: Rodrigo Nardi Date: Wed, 25 Sep 2024 16:52:45 -0300 Subject: [PATCH] Execution time Increasing code coverage Signed-off-by: Rodrigo Nardi --- spec/lib/models/ci_job_spec.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/spec/lib/models/ci_job_spec.rb b/spec/lib/models/ci_job_spec.rb index a98d343..2a22f59 100644 --- a/spec/lib/models/ci_job_spec.rb +++ b/spec/lib/models/ci_job_spec.rb @@ -80,4 +80,23 @@ end end end + + describe '#execution_time' do + let(:stage) { create(:ci_job, check_ref: nil) } + + context 'when CiJob started and finished' do + it 'must update status' do + stage.in_progress(github) + stage.success(github) + stage.update_execution_time + end + end + + context 'when CiJob started and not finished' do + it 'must update status' do + stage.in_progress(github) + stage.update_execution_time + end + end + end end