aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-09-14 16:23:21 +0100
committerFrancis Irving <francis@mysociety.org>2010-09-14 16:23:21 +0100
commitad579293d65f99fd19a770b807dcb2753623f05a (patch)
tree52abb2bb4fff7dd68f5688304e63f9033971047c /spec/controllers/request_controller_spec.rb
parent4dc2ce5f2e77576486eba2a87b1d15d26948a244 (diff)
Mock views for new syntax of calling search
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb6
1 files changed, 5 insertions, 1 deletions
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