Commit a5bd978a authored by Jasper Maes's avatar Jasper Maes

Rails5 fix Mysql comparison failure caused by milliseconds problem

parent 07de43a7
---
title: Rails5 fix Mysql comparison failure caused by milliseconds problem
merge_request: 20222
author: Jasper Maes
type: fixed
...@@ -534,12 +534,19 @@ describe Discussion, ResolvableDiscussion do ...@@ -534,12 +534,19 @@ 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
Timecop.freeze(time - 1.second) do
first_note.resolve!(current_user) first_note.resolve!(current_user)
end
Timecop.freeze(time) do
third_note.resolve!(current_user) third_note.resolve!(current_user)
end
Timecop.freeze(time + 1.second) do
second_note.resolve!(current_user) 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
expect(subject.last_resolved_note).to eq(second_note) expect(subject.last_resolved_note).to eq(second_note)
......
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