Commit 6cb95116 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rails5-mysql-milliseconds-project-spec' into 'master'

Rails5: fix mysql milliseconds problem in project_spec

See merge request gitlab-org/gitlab-ee!6880
parents 57cb82cb 0a1f4440
---
title: 'Rails5: fix mysql milliseconds problem in project_spec'
merge_request: 6880
author: Jasper Maes
type: fixed
......@@ -60,7 +60,7 @@ describe Project do
project.save
end.to change { ProjectImportState.count }.by(1)
expect(project.import_state.next_execution_timestamp).to eq(Time.now)
expect(project.import_state.next_execution_timestamp).to be_like_time(Time.now)
end
end
end
......@@ -75,7 +75,7 @@ describe Project do
project.update(mirror: true, mirror_user_id: project.creator.id, import_url: generate(:url))
end.to change { ProjectImportState.count }.by(1)
expect(project.import_state.next_execution_timestamp).to eq(Time.now)
expect(project.import_state.next_execution_timestamp).to be_like_time(Time.now)
end
end
end
......@@ -89,7 +89,7 @@ describe Project do
project.update(mirror: true, mirror_user_id: project.creator.id)
end.not_to change { ProjectImportState.count }
expect(project.import_state.next_execution_timestamp).to eq(Time.now)
expect(project.import_state.next_execution_timestamp).to be_like_time(Time.now)
end
end
end
......@@ -377,7 +377,7 @@ describe Project do
describe '#force_import_job!' do
it 'sets next execution timestamp to now and schedules UpdateAllMirrorsWorker' do
timestamp = Time.now
timestamp = 1.second.from_now.change(usec: 0)
project = create(:project, :mirror)
expect(UpdateAllMirrorsWorker).to receive(:perform_async)
......@@ -396,7 +396,7 @@ describe Project do
Timecop.freeze(timestamp) do
expect { project.force_import_job! }.to change(project.import_state, :retry_count).to(0)
expect(project.import_state.next_execution_timestamp).to eq(timestamp)
expect(project.import_state.next_execution_timestamp).to be_like_time(timestamp)
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