diff options
author | Rémy Coutable <remy@rymai.me> | 2018-07-09 19:02:56 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-07-09 19:02:56 +0300 |
commit | e2f7fbe4393a5897f88f3e455a556ad74a312cbf (patch) | |
tree | 743bde33e369fdbc126f7092ec5c941682a319c2 /spec | |
parent | 4bb26e7dad14fbb0891b1d06f70deef6486c87ad (diff) | |
parent | fbb48bd7e9e20037bb5a1b79e70f68f2d4bc3170 (diff) |
Merge branch 'rails5-fix-48977' into 'master'
Rails5 fix mysql milliseconds problem in specs
Closes #48977
See merge request gitlab-org/gitlab-ce!20464
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/user_spec.rb | 4 | ||||
-rw-r--r-- | spec/services/ci/retry_build_service_spec.rb | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 097144d04ce..57c408498dd 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -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 diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb index decb5d22f59..b8cdbc8c0f6 100644 --- a/spec/services/ci/retry_build_service_spec.rb +++ b/spec/services/ci/retry_build_service_spec.rb @@ -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 |