Rails 5: fix mysql milliseconds problems in scheduled build specs
This commit is contained in:
parent
50c9a09a04
commit
043f899b2a
4 changed files with 8 additions and 3 deletions
5
changelogs/unreleased/rails5-mysql-schedule-build.yml
Normal file
5
changelogs/unreleased/rails5-mysql-schedule-build.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: 'Rails 5: fix mysql milliseconds problems in scheduled build specs'
|
||||
merge_request: 22170
|
||||
author: Jasper Maes
|
||||
type: other
|
|
@ -17,7 +17,7 @@ describe Gitlab::Ci::Status::Build::Scheduled do
|
|||
let(:build) { create(:ci_build, scheduled_at: 1.minute.since, project: project) }
|
||||
|
||||
it 'shows execute_in of the scheduled job' do
|
||||
Timecop.freeze do
|
||||
Timecop.freeze(Time.now.change(usec: 0)) do
|
||||
expect(subject.status_tooltip).to include('00:01:00')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -261,7 +261,7 @@ describe Ci::Build do
|
|||
it 'schedules BuildScheduleWorker at the right time' do
|
||||
Timecop.freeze do
|
||||
expect(Ci::BuildScheduleWorker)
|
||||
.to receive(:perform_at).with(1.minute.since, build.id)
|
||||
.to receive(:perform_at).with(be_like_time(1.minute.since), build.id)
|
||||
|
||||
subject
|
||||
end
|
||||
|
|
|
@ -227,7 +227,7 @@ describe Ci::BuildPresenter do
|
|||
|
||||
it 'returns execution time' do
|
||||
Timecop.freeze do
|
||||
is_expected.to eq(60.0)
|
||||
is_expected.to be_like_time(60.0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue