aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration/errors_spec.rb
Commit message (Collapse)AuthorAgeLines
* Revert "Use rack-utf8_sanitizer gem"Louise Crow2014-12-22-6/+8
| | | | | | | | This reverts commit 45f25290e2e4a1f33ec5d3df6ecfb40300318ece. Use of the :ruby_20 platform requires bundler 1.3, which is not available on all our supported OSes as a package. See https://github.com/mysociety/alaveteli/issues/1276 for details.
* Use RESTful routing for index and show actionsLouise Crow2014-12-12-1/+1
|
* Merge branch 'sanitize-non-utf8-request-uri' into rails-3-developLouise Crow2014-12-09-8/+6
|\
| * Use rack-utf8_sanitizer gemLouise Crow2014-11-18-8/+6
| | | | | | | | This sanitises non utf-8 params before they're processed by Rails.
* | Don't display specific error messages in production.Louise Crow2014-12-05-3/+0
|/
* Comment out spec which sends an invalid utf-8 param.0.19.0.9hotfix/0.19.0.9Louise Crow2014-10-31-6/+9
| | | | | | | | | | | | | | | | | | | | | | | The original error `ActionView::Template::Error` that this spec was written to represent (#1406) occurred under ruby 1.8 when the decoded non-utf-8 string was used in the locale switcher on the 'not found' error page to generate a url for the alternative locales. Under Ruby >= 1.9, the error thrown in that situation is an `invalid byte sequence in UTF-8` error, thrown in the same place - the locale switcher. However, no error seems to be thrown when the same param is used in a request in production. The upgrade to Rails 3.2.20 causes `String.split` to be called on the request path in `actionpack/lib/action_dispatch/middleware/static.rb` in order to check for attempts to access files outside the `public` directory. This means that under Ruby >= 1.9, an `invalid byte sequence in UTF-8` error will be thrown there in running this spec. I think a possible solution is to use the `rack-utf8_sanitizer` gem to provide middleware to strip invalid utf-8 from request URIs and headers before they're processed by Rails, but it's currently unclear whether that would have any undesirable side-effects.
* Rescue from non-numeric page parameter exceptionsGareth Rees2014-04-10-0/+8
| | | | | | will_paginate intentionally throws an ArgumentError when a non-numeric page parameter is used. Conveniently, they tag it with WillPaginate::InvalidPage, so here we rescue with a 404.
* URL Encode the path parameter for render_exceptionGareth Rees2014-03-31-0/+7
| | | | | | | | | | | | | | | | | | | | | | If a request is made and path is something like /%d3 we rescue this with a custom 404 template. This gets unescaped as {"path"=>"\323"}. In the case of a RouteNotFound, ApplicationController#render_exception renders the general/exception_caught template in to the default layout, which renders the general/_locale_switcher partial. This partial calls url_for – sending the full params hash as the argument – so that a user may return to the existing page in their chosen locale. The problem is that url_for tries to construct the url with the hash {:action=>"not_found", :controller=>"general", :path=>"\323"}. ApplicationController#sanitize_params re-encodes the path parameter so that it can be passed through to url_for without trouble.
* For non-HTML requests, just return the response code for now.Louise Crow2013-06-03-0/+17
|
* Add encoding line as we use utf-8 in the tests.Louise Crow2013-05-02-0/+1
|
* Add logging of any errors.Louise Crow2013-05-02-1/+6
|
* Clearer setting of status code, addition of notification.Louise Crow2013-05-02-3/+5
|
* Rewrite specs to more clearly represent expected behaviour - exceptions and ↵Louise Crow2013-05-02-29/+94
| | | | 404s on non-local requests are to be rendered with our custom template (such that this template can be overriden by themes in the usual way). Note that requests to the admin interface are considered local.
* Remove test of rails internals that is somehow interfering with other testsMatthew Landauer2013-03-19-4/+0
|
* There's really no need to test the internals of RailsMatthew Landauer2013-01-31-9/+0
|
* if the response code doesn't match, the failure message is unhelpfulJames McKinney2012-11-01-2/+7
|
* File.dirname(__FILE__) is not necessarily absoluteRobin Houston2012-06-03-1/+1
| | | | | | | It’s weird that there’s so much code here that implicitly assumes File.dirname(__FILE__) is an absolute path, because really in general it very much is not! This assumption was invalidated by the recent bundler-awareness changes.
* Load all fixtures for all testsRobin Houston2012-01-31-14/+0
| | | | | | | | | The ad hoc specification of fixtures has been an ongoing source of bugs in the tests. The straw that broke the camel’s back is that 7c6eb09 requires the fixtures to be loaded in order (i.e. children before their parents), and it would have been a painful process to reorder all the dozens of different fixture lists, but the test system ought to be more reliable this way.
* Load all raw emails for testingRobin Houston2012-01-29-1/+1
| | | | | | | | | | | Previously there was just one raw email, and the test code relied on that fact. Generalise it to handle multiple raw emails. This change causes a number of tests to fail, because it exposes failures that should have happened when the second raw email was added but were masked by the fact that the text of this second raw email was never loaded. These failures will be fixed in the next commit.
* Don't allow directory listings (better fix for and closes #340).Seb Bacon2012-01-17-3/+6
|
* Further refinement for issue #340Seb Bacon2012-01-13-0/+2
|
* Return 404 for non-existent 'details' pages. Fixes #325Seb Bacon2012-01-12-0/+4
|
* Return 403 when attachment "folders" are spidered. Fixes #340Seb Bacon2012-01-12-0/+4
|
* allow specs to run independentlyJames McKinney2011-10-16-9/+13
|
* Fix integration test breaking custom states specDavid Cabo2011-09-03-18/+2
|
* Distinguish between 404s and other errors. Fixes #161.Seb Bacon2011-08-30-0/+61