summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-06-29 09:35:58 +0000
committerRémy Coutable <remy@rymai.me>2018-06-29 09:35:58 +0000
commit54692746c9e710e61952ddfa22ef84367a4c2b72 (patch)
treeb7eb5234f4311cb5ba8cb60cede3bc1a6f27e147 /spec
parent586045e2034f221944893b3d2482f440fa0d6c4b (diff)
parenta5bd978ad7d856d4171a413e3a17b2ead4092dea (diff)
downloadgitlab-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.rb13
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