aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb21
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 26e46a966..2d3ccfa63 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -2392,6 +2392,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
@@ -2442,7 +2459,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)
@@ -2655,7 +2672,7 @@ describe RequestController, "#select_authorities" do
end
- context 'when asked for JSON', :focus => true do
+ context 'when asked for JSON' do
it 'should be successful' do
get :select_authorities, {:public_body_query => "Quan", :format => 'json'}, {:user_id => @user.id}