diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-04-07 11:04:40 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-04-07 11:04:40 +0100 |
commit | 360898c6e0321e4b431fc18454af38a028330853 (patch) | |
tree | f7558dbcd5d6fe266c09df4ad9d623167f8cec64 /spec/controllers/public_body_controller_spec.rb | |
parent | 7d2487bbc816a674817f3811d4b8f87072c72632 (diff) |
Limit the number of pages of requests shown for public bodies.
Needs to be restored as part of https://github.com/mysociety/alaveteli/issues/2137.
Diffstat (limited to 'spec/controllers/public_body_controller_spec.rb')
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index 130631ef6..ff0a70a6f 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -82,6 +82,13 @@ describe PublicBodyController, "when showing a body" do expect(flash[:search_params]).to eq(search_params) end + + it 'should not show high page offsets as these are extremely slow to generate' do + lambda { + get :show, { :url_name => 'dfh', :view => 'all', :page => 25 } + }.should raise_error(ActiveRecord::RecordNotFound) + end + end describe PublicBodyController, "when listing bodies" do |