Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-01-26 13:54:57 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2016-01-27 12:33:33 +0300
commitde7c9c7ab17a8b36ca0c645ba1a7a6971a077fb1 (patch)
tree96254ba55bfe11bbd5ef8221afb1a37369e9737b /spec/models/event_spec.rb
parent128a6411d2a60c855e3c99303d0157f436e32f13 (diff)
Use Atom update times of the first event
By simply loading the first event from the already sorted set we save ourselves extra (slow) queries just to get the latest update timestamp. This removes the need for Event.latest_update_time and significantly reduces the time needed to build an Atom feed. Fixes gitlab-org/gitlab-ce#12415
Diffstat (limited to 'spec/models/event_spec.rb')
-rw-r--r--spec/models/event_spec.rb21
1 files changed, 0 insertions, 21 deletions
diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb
index 071582b0282..ec2a923f91b 100644
--- a/spec/models/event_spec.rb
+++ b/spec/models/event_spec.rb
@@ -65,27 +65,6 @@ describe Event, models: true do
it { expect(@event.author).to eq(@user) }
end
- describe '.latest_update_time' do
- describe 'when events are present' do
- let(:time) { Time.utc(2015, 1, 1) }
-
- before do
- create(:closed_issue_event, updated_at: time)
- create(:closed_issue_event, updated_at: time + 5)
- end
-
- it 'returns the latest update time' do
- expect(Event.latest_update_time).to eq(time + 5)
- end
- end
-
- describe 'when no events exist' do
- it 'returns nil' do
- expect(Event.latest_update_time).to be_nil
- end
- end
- end
-
describe '.limit_recent' do
let!(:event1) { create(:closed_issue_event) }
let!(:event2) { create(:closed_issue_event) }