| Commit message (Collapse) | Author | Age | Lines |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\ |
|
| |
| |
| |
| | |
This sanitises non utf-8 params before they're processed by Rails.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|