Commit 54692746 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rails5-fix-48432' into 'master'

Rails5 fix Mysql comparison failure caused by milliseconds problem

Closes #48432

See merge request gitlab-org/gitlab-ce!20222
parents 586045e2 a5bd978a
---
title: Rails5 fix Mysql comparison failure caused by milliseconds problem
merge_request: 20222
author: Jasper Maes
type: fixed
...@@ -534,11 +534,18 @@ describe Discussion, ResolvableDiscussion do ...@@ -534,11 +534,18 @@ describe Discussion, ResolvableDiscussion do
describe "#last_resolved_note" do describe "#last_resolved_note" do
let(:current_user) { create(:user) } let(:current_user) { create(:user) }
let(:time) { Time.now.utc }
before do before do
first_note.resolve!(current_user) Timecop.freeze(time - 1.second) do
third_note.resolve!(current_user) first_note.resolve!(current_user)
second_note.resolve!(current_user) end
Timecop.freeze(time) do
third_note.resolve!(current_user)
end
Timecop.freeze(time + 1.second) do
second_note.resolve!(current_user)
end
end end
it "returns the last note that was resolved" do it "returns the last note that was resolved" 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