diff options
-rw-r--r-- | changelogs/unreleased/rails5-fix-48432.yml | 5 | ||||
-rw-r--r-- | spec/models/concerns/resolvable_discussion_spec.rb | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/changelogs/unreleased/rails5-fix-48432.yml b/changelogs/unreleased/rails5-fix-48432.yml new file mode 100644 index 00000000000..732294447a9 --- /dev/null +++ b/changelogs/unreleased/rails5-fix-48432.yml @@ -0,0 +1,5 @@ +--- +title: Rails5 fix Mysql comparison failure caused by milliseconds problem +merge_request: 20222 +author: Jasper Maes +type: fixed diff --git a/spec/models/concerns/resolvable_discussion_spec.rb b/spec/models/concerns/resolvable_discussion_spec.rb index 2a2ef5a304d..2f9f63ce7e0 100644 --- a/spec/models/concerns/resolvable_discussion_spec.rb +++ b/spec/models/concerns/resolvable_discussion_spec.rb @@ -534,11 +534,18 @@ describe Discussion, ResolvableDiscussion do describe "#last_resolved_note" do let(:current_user) { create(:user) } + let(:time) { Time.now.utc } before do - first_note.resolve!(current_user) - third_note.resolve!(current_user) - second_note.resolve!(current_user) + Timecop.freeze(time - 1.second) do + first_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 it "returns the last note that was resolved" do |