From ad579293d65f99fd19a770b807dcb2753623f05a Mon Sep 17 00:00:00 2001 From: Francis Irving Date: Tue, 14 Sep 2010 16:23:21 +0100 Subject: Mock views for new syntax of calling search --- spec/controllers/request_controller_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'spec/controllers/request_controller_spec.rb') diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 2b1531464..fa43b4012 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -17,9 +17,13 @@ describe RequestController, "when listing recent requests" do end it "should assign the first page of results" do + xap_results = mock_model(ActsAsXapian::Search, + :results => (1..25).to_a.map { |m| { :model => m } }, + :matches_estimated => 103) + InfoRequest.should_receive(:full_search). with([InfoRequestEvent],"variety:sent", "created_at", anything, anything, anything, anything). - and_return((1..25).to_a) + and_return(xap_results) get :list, :view => 'recent' assigns[:list_results].size.should == 25 end -- cgit v1.2.3