diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-02-03 12:25:11 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-02-03 13:37:33 +0000 |
commit | f759a8af65124374279ecfecd6115bd12efa4d59 (patch) | |
tree | 6ffe899ea7b71fdf41b51bc176370467fabaeb99 /spec/controllers/general_controller_spec.rb | |
parent | 458325acd055f678d03c3ae8594ae8c48c35ffe6 (diff) |
Do not allow requests for search results after the first 500
The pages for these search results are extremely slow to load. This
is not an ideal solution by any means. Really we want to dig into why
high offsets are so slow, and whether there's anything we can do to
fix that.
Diffstat (limited to 'spec/controllers/general_controller_spec.rb')
-rw-r--r-- | spec/controllers/general_controller_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index cb00b301c..8652d9b17 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -262,4 +262,10 @@ describe GeneralController, 'when using xapian search' do response.body.should include('Track this search') end + it 'should not show high page offsets as these are extremely slow to generate' do + lambda { + get :search, :combined => 'bob/all', :page => 25 + }.should raise_error(ActiveRecord::RecordNotFound) + end + end |