File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,6 @@ def execution_started?
5050 end
5151
5252 def last_job_updated_at_timer
53- ci_jobs . max_by ( &:updated_at ) . to_s . updated_at
53+ ci_jobs . max_by ( &:updated_at ) & .updated_at
5454 end
5555end
Original file line number Diff line number Diff line change 2222 end
2323 end
2424
25- context '#last_job_updated_at_timer?' do
26- let ( :ci_job ) { create ( :ci_job , updated_at : nil ) }
25+ context '#last_job_updated_at_timer? -> success ' do
26+ let ( :ci_job ) { create ( :ci_job ) }
2727 let ( :check_suite ) { create ( :check_suite , ci_jobs : [ ci_job ] ) }
28- let ( :check_suite_running ) { create ( :check_suite , :with_in_progress ) }
2928
3029 it 'returns false' do
31- expect ( check_suite_running . last_job_updated_at_timer ) . not_to be_nil
30+ expect ( check_suite . last_job_updated_at_timer ) . not_to be_nil
31+ end
32+ end
33+
34+ context '#last_job_updated_at_timer? -> error' do
35+ let ( :ci_job ) { create ( :ci_job , updated_at : nil ) }
36+ let ( :check_suite ) { create ( :check_suite , ci_jobs : [ ] ) }
37+
38+ it 'returns false' do
39+ expect ( check_suite . last_job_updated_at_timer ) . to be_nil
3240 end
3341 end
3442end
You can’t perform that action at this time.
0 commit comments