@@ -43,24 +43,28 @@ class MissionControl::Jobs::JobsControllerTest < ActionDispatch::IntegrationTest
4343 end
4444
4545 test "get finished jobs filtered by finished_at date" do
46- job = DummyJob . perform_later ( 42 )
47- perform_enqueued_jobs_async
48-
49- get mission_control_jobs . application_jobs_url ( @application , :finished )
50- assert_response :ok
51- assert_select "tr.job" , 1
52-
53- get mission_control_jobs . application_jobs_url ( @application , :finished , filter : { finished_at_start : 1 . hour . from_now . to_s } )
54- assert_response :ok
55- assert_select "tr.job" , 0
56-
57- get mission_control_jobs . application_jobs_url ( @application , :finished , filter : { finished_at_start : 1 . hour . ago . to_s , finished_at_end : 1 . hour . from_now } )
58- assert_response :ok
59- assert_select "tr.job" , 1
60-
61- get mission_control_jobs . application_jobs_url ( @application , :finished , filter : { finished_at_end : 1 . hour . from_now } )
62- assert_response :ok
63- assert_select "tr.job" , 1
46+ [ "UTC" , "International Date Line West" ] . each do |timezone |
47+ Time . use_zone ( timezone ) do
48+ job = DummyJob . perform_later ( 42 )
49+ perform_enqueued_jobs_async
50+
51+ get mission_control_jobs . application_jobs_url ( @application , :finished )
52+ assert_response :ok
53+ assert_select "tr.job" , 1
54+
55+ get mission_control_jobs . application_jobs_url ( @application , :finished , filter : { finished_at_start : 1 . hour . from_now . strftime ( "%Y-%m-%dT%H:%M" ) } )
56+ assert_response :ok
57+ assert_select "tr.job" , 0
58+
59+ get mission_control_jobs . application_jobs_url ( @application , :finished , filter : { finished_at_start : 1 . hour . ago . strftime ( "%Y-%m-%dT%H:%M" ) , finished_at_end : 1 . hour . from_now . strftime ( "%Y-%m-%dT%H:%M" ) } )
60+ assert_response :ok
61+ assert_select "tr.job" , 1
62+
63+ get mission_control_jobs . application_jobs_url ( @application , :finished , filter : { finished_at_end : 1 . hour . from_now . strftime ( "%Y-%m-%dT%H:%M" ) } )
64+ assert_response :ok
65+ assert_select "tr.job" , 1
66+ end
67+ end
6468 end
6569
6670 test "redirect to queue when job doesn't exist" do
0 commit comments