From f6cd280bbfafa2151ededb8280407686fb73e8a7 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Sun, 29 Jan 2012 19:12:01 +0000 Subject: Test duplicate requests are coalesced Test that duplicate requests are coalesced on the front page. --- spec/controllers/general_controller_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'spec/controllers/general_controller_spec.rb') diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index 6c9f8b88d..9a5421a78 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -126,6 +126,11 @@ describe GeneralController, "when searching" do get :frontpage assigns[:request_events].first.info_request.should == info_requests(:another_boring_request) end + + it 'should coalesce duplicate requests' do + get :frontpage + assigns[:request_events].map(&:info_request).select{|x|x.url_title =~ /^spam/}.length.should == 1 + end end describe 'when using xapian search' do -- cgit v1.2.3