diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-12-01 14:52:16 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-12-06 15:59:37 +0100 |
commit | 856447ccd305832c4e9421ab9e81d63eea348203 (patch) | |
tree | 99df49e2050a3dcb2f2d289a8a728fa5b28f83be /spec/models/issue_spec.rb | |
parent | 483b5f1bfac5e338fab0e11f2045254f70df8fc1 (diff) | |
download | gitlab-ce-856447ccd305832c4e9421ab9e81d63eea348203.tar.gz |
Throttle the number of UPDATEs triggered by touch
This throttles the number of UPDATE queries that can be triggered by
calling "touch" on a Note, Issue, or MergeRequest. For Note objects we
also take care of updating the associated "noteable" relation in a
smarter way than Rails does by default.
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r-- | spec/models/issue_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 5f901262598..0ea287d007a 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -765,4 +765,8 @@ describe Issue do expect(described_class.public_only).to eq([public_issue]) end end + + it_behaves_like 'throttled touch' do + subject { create(:issue, updated_at: 1.hour.ago) } + end end |