提交 fbb48bd7 编写于 作者: J Jasper Maes

Rails5 fix mysql milliseconds problem in specs

上级 96eb6fd3
---
title: Rails5 fix mysql milliseconds problem in specs
merge_request: 20464
author: Jasper Maes
type: fixed
......@@ -2461,7 +2461,9 @@ describe User do
it 'changes the namespace (just to compare to when username is not changed)' do
expect do
user.update_attributes!(username: new_username)
Timecop.freeze(1.second.from_now) do
user.update_attributes!(username: new_username)
end
end.to change { user.namespace.updated_at }
end
......
......@@ -100,7 +100,11 @@ describe Ci::RetryBuildService do
end
describe '#execute' do
let(:new_build) { service.execute(build) }
let(:new_build) do
Timecop.freeze(1.second.from_now) do
service.execute(build)
end
end
context 'when user has ability to execute build' do
before do
......@@ -150,7 +154,11 @@ describe Ci::RetryBuildService do
end
describe '#reprocess' do
let(:new_build) { service.reprocess!(build) }
let(:new_build) do
Timecop.freeze(1.second.from_now) do
service.reprocess!(build)
end
end
context 'when user has ability to execute build' do
before do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册