File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,38 @@ public function when_a_job_is_released_it_will_be_updated_in_the_dashboard()
439439 'status ' => 'released ' ,
440440 'datetime ' => now ()->toDateTimeString (),
441441 'diff ' => '1 second ago ' ,
442+ 'delay ' => 0 ,
443+ ],
444+ $ events [2 ]
445+ );
446+ }
447+
448+ /**
449+ * @test
450+ */
451+ public function job_release_delay_is_added_to_the_metadata ()
452+ {
453+ // Arrange
454+ \Illuminate \Support \Carbon::setTestNow (now ());
455+ CloudTasksApi::fake ();
456+ OpenIdVerificator::fake ();
457+ CloudTasksApi::partialMock ()->shouldReceive ('getRetryConfig ' )->andReturn (
458+ (new RetryConfig ())->setMaxAttempts (3 )
459+ );
460+
461+ $ this ->dispatch (new JobThatWillBeReleased (15 ))->run ();
462+
463+ // Assert
464+ $ task = StackkitCloudTask::firstOrFail ();
465+ $ events = $ task ->getEvents ();
466+
467+ $ this ->assertCount (3 , $ events );
468+ $ this ->assertEquals (
469+ [
470+ 'status ' => 'released ' ,
471+ 'datetime ' => now ()->toDateTimeString (),
472+ 'diff ' => '1 second ago ' ,
473+ 'delay ' => 15 ,
442474 ],
443475 $ events [2 ]
444476 );
You can’t perform that action at this time.
0 commit comments