From c8fc7884e1e13e7a46ea720fe7fd4d47d095a67f Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 30 Oct 2014 12:47:58 +0000 Subject: RequestController#search_typeahead filter by body Action now supports the `request_from` param as per the Xapian filtering system to filter search typeaheads by public body --- spec/controllers/request_controller_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (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 6c0f4573e..ce91f7a83 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -2380,6 +2380,12 @@ describe RequestController, "when doing type ahead searches" do get :search_typeahead, :q => "dog -chicken" assigns[:xapian_requests].results.size.should == 1 end + + it 'can filter search results by public body' do + get :search_typeahead, :q => 'boring', :requested_from => 'dfh' + expect(assigns[:query]).to eq('requested_from:dfh boring') + end + end describe RequestController, "when showing similar requests" do -- cgit v1.2.3