@@ -361,28 +361,28 @@ def pick_quarter(quarter)
361
361
fill_in 'datafile[url]' , with : 'https://localhost/doc'
362
362
fill_in 'datafile[name]' , with : 'my test doc'
363
363
choose option : quarter . to_s
364
- fill_in "datafile[year]" , with : Date . today . year
364
+ fill_in "datafile[year]" , with : Time . zone . today . year
365
365
click_button "Save and continue"
366
366
end
367
367
368
368
it "calculates correct dates for Q1" do
369
369
pick_quarter ( 1 )
370
- expect ( Dataset . last . datafiles . last . end_date ) . to eq ( Date . new ( Date . today . year , 6 ) . end_of_month )
370
+ expect ( Dataset . last . datafiles . last . end_date ) . to eq ( Date . new ( Time . zone . today . year , 6 ) . end_of_month )
371
371
end
372
372
373
373
it "calculates correct dates for Q2" do
374
374
pick_quarter ( 2 )
375
- expect ( Dataset . last . datafiles . last . end_date ) . to eq ( Date . new ( Date . today . year , 9 ) . end_of_month )
375
+ expect ( Dataset . last . datafiles . last . end_date ) . to eq ( Date . new ( Time . zone . today . year , 9 ) . end_of_month )
376
376
end
377
377
378
378
it "calculates correct dates for Q3" do
379
379
pick_quarter ( 3 )
380
- expect ( Dataset . last . datafiles . last . end_date ) . to eq ( Date . new ( Date . today . year , 12 ) . end_of_month )
380
+ expect ( Dataset . last . datafiles . last . end_date ) . to eq ( Date . new ( Time . zone . today . year , 12 ) . end_of_month )
381
381
end
382
382
383
383
it "calculates correct dates for Q4" do
384
384
pick_quarter ( 4 )
385
- expect ( Dataset . last . datafiles . last . end_date ) . to eq ( Date . new ( Date . today . year , 3 ) . end_of_month + 1 . year )
385
+ expect ( Dataset . last . datafiles . last . end_date ) . to eq ( Date . new ( Time . zone . today . year , 3 ) . end_of_month + 1 . year )
386
386
end
387
387
end
388
388
0 commit comments