diff options
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 6c0f4573e..ba558cc93 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -2380,6 +2380,23 @@ 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 + + it 'defaults to 25 results per page' do + get :search_typeahead, :q => 'boring' + expect(assigns[:per_page]).to eq(25) + end + + it 'can limit the number of searches returned' do + get :search_typeahead, :q => 'boring', :per_page => '1' + expect(assigns[:per_page]).to eq(1) + expect(assigns[:xapian_requests].results.size).to eq(1) + end + end describe RequestController, "when showing similar requests" do @@ -2430,7 +2447,7 @@ describe RequestController, "when caching fragments" do :info_request_id => 132, :id => 44, :get_attachments_for_display => nil, - :html_mask_stuff! => nil, + :apply_masks! => nil, :user_can_view? => true, :all_can_view? => true) attachment = FactoryGirl.build(:body_text, :filename => long_name) |