Commit fbb48bd7 authored by Jasper Maes's avatar Jasper Maes

Rails5 fix mysql milliseconds problem in specs

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