diff options
author | tony <tony> | 2009-03-20 09:35:42 +0000 |
---|---|---|
committer | tony <tony> | 2009-03-20 09:35:42 +0000 |
commit | 819fe8a6c7db2fc52794a0d6ea739d1faa72f615 (patch) | |
tree | 3ca143c4e2cc1486a0538be6001e05c23211f24b /spec/controllers/request_controller_spec.rb | |
parent | fffd9452ac266bff7152b0e5f5c2f3042c26442e (diff) |
Switch recent request test from fixtures to stubs
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index a88fd94e3..e37d5bf7a 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -1,13 +1,6 @@ require File.dirname(__FILE__) + '/../spec_helper' describe RequestController, "when listing recent requests" do - integrate_views - fixtures :info_requests, :outgoing_messages, :info_request_events - - before do - rebuild_xapian_index - end - it "should be successful" do get :list, :view => 'recent' response.should be_success @@ -19,16 +12,11 @@ describe RequestController, "when listing recent requests" do end it "should assign the first page of results" do - # XXX probably should load more than one page of requests into db here :) - ActsAsXapian.update_index - + InfoRequest.should_receive(:full_search). + with([InfoRequestEvent],"variety:sent", "created_at", anything, anything, anything, anything). + and_return((1..25).to_a) get :list, :view => 'recent' - - # reverse-chronological order - assigns[:xapian_object].matches_estimated.should == 2 - assigns[:xapian_object].results.size.should == 2 - assigns[:xapian_object].results[0][:model].should == info_request_events(:silly_outgoing_message_event) - assigns[:xapian_object].results[1][:model].should == info_request_events(:useless_outgoing_message_event) + assigns[:xapian_object].size.should == 25 end end |