diff options
author | Rémy Coutable <remy@rymai.me> | 2018-06-29 09:35:58 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-06-29 09:35:58 +0000 |
commit | 54692746c9e710e61952ddfa22ef84367a4c2b72 (patch) | |
tree | b7eb5234f4311cb5ba8cb60cede3bc1a6f27e147 /spec | |
parent | 586045e2034f221944893b3d2482f440fa0d6c4b (diff) | |
parent | a5bd978ad7d856d4171a413e3a17b2ead4092dea (diff) | |
download | gitlab-ce-54692746c9e710e61952ddfa22ef84367a4c2b72.tar.gz |
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
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/concerns/resolvable_discussion_spec.rb | 13 |
1 files changed, 10 insertions, 3 deletions
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 |