Commit 043f899b authored by Jasper Maes's avatar Jasper Maes

Rails 5: fix mysql milliseconds problems in scheduled build specs

parent 50c9a09a
---
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment