Merge branch 'rails5-mysql-schedule-build' into 'master'

Rails 5: fix mysql milliseconds problems in scheduled build specs

See merge request gitlab-org/gitlab-ce!22170
This commit is contained in:
Douwe Maan 2018-10-08 10:56:06 +00:00
commit 7f22bc983d
4 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
title: 'Rails 5: fix mysql milliseconds problems in scheduled build specs'
merge_request: 22170
author: Jasper Maes
type: other

View file

@ -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

View file

@ -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

View file

@ -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