aboutsummaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeLines
* Handle non-UTF8 encoding in ruby 1.9 and aboveLouise Crow2015-06-25-5/+56
|
* Correctly set uuencoded attachment file size2508-hotfix-bad-uudecodeGareth Rees2015-06-04-0/+1
|
* Use Ruby to decode uuencoded attachmentsGareth Rees2015-06-03-0/+2880
| | | | | | | | | | | | | | | | | | | | | | | | | | Ruby can natively decode uuencoded text with String#unpack. [1] This avoids the uuencode program dependency and avoids writing tempfiles. The actual implementation is taken from mail [2]. The UnixToUnix module is not available in our bundled version of mail. This commit includes a spec to illustrate the failure of uuencode(1) to decode the particular attachment in incoming-request-bad-uuencoding-2. email. Parsing with uuencode returns the following error: External Command: Error from command "uudecode -o /dev/stdout /tmp/foiuu20150530-14811-u6j936": uudecode: /tmp/foiuu20150530-14811-u6j936: No `end' line The file _is_ created and appears to be OK, but the exit code is 1. This causes AlaveteliExternalCommand to fail and return nil. See #2508 [3] for the bug report. [1] http://ruby-doc.org/core-1.8.7/String.html#method-i-unpack [2] https://github.com/mikel/mail/blob/bc4c9bb9321e9d36a678692f2f562d3146b63f78/lib/mail/encodings/unix_to_unix.rb#L7 [3] https://github.com/mysociety/alaveteli/issues/2508
* Add spec for simple uuencoded attachmentGareth Rees2015-06-03-0/+33
| | | Inspired by https://github.com/mikel/mail/commit/bc4c9bb9321e9d36a678692f2f562d3146b63f78
* Go back to setting up xapian index with fixturesLouise Crow2015-05-29-4/+6
| | | | | | Skipping this seems to have some unexpected interaction with fixture data. https://travis-ci.org/mysociety/alaveteli/jobs/64446161
* Address#to_s changes the input passed to it - dup before calling.Louise Crow2015-05-28-0/+17
| | | | Otherwise UTF-8 encoded strings will be returned as ASCII-8BIT.
* Fix encoding issue with searching for macronsCaleb2015-05-28-0/+11
| | | | Correct indentation to be consistent
* Merge branch 'handle-unparsed-email-as-binary' into hotfix/0.21.0.33Louise Crow2015-05-28-30/+43
|\
| * Handle unparsed email contents as binary.Louise Crow2015-05-26-11/+38
| | | | | | | | | | | | | | | | | | | | | | I think I was wrong in a83b379fd2d676172855825d0592937b234371e2 in assuming that all email gets properly encoded for transfer. Looking at the mail gem load method https://github.com/mikel/mail/blob/b159e0a542962fdd5e292a48cfffa560d7cf412e/lib/mail/mail.rb#L175a, it reads raw email content from a file in binary mode. So this commit makes both reading and writing the raw_email a binary mode operation and adds a data_as_text method for displaying the data in the admin interface that coerces it to valid utf-8.
| * Cleanup spec.Louise Crow2015-05-22-13/+14
| | | | | | | | Move setup to spec - not in common with other specs.
| * Remove obsolete testLouise Crow2015-05-22-19/+4
| | | | | | | | | | We don't write the data for a raw email to the database anymore. It's written to a file.
* | Add required setupLouise Crow2015-05-28-11/+18
| |
* | Make sure spelling corrections are encoded as UTF-8Louise Crow2015-05-28-0/+29
| |
* | Cleanup spec.Louise Crow2015-05-26-52/+54
| | | | | | | | Remove unneeded setup, fixtures are not used in these specs.
* | Move acts_as_xapian specs to own file.Louise Crow2015-05-26-71/+73
|/
* Handle invalid 'to' addresses.Louise Crow2015-05-22-0/+10
|
* Use mb_chars to prevent slicing multibyte chars under ruby 1.8Louise Crow2015-05-15-0/+12
| | | | | | | | | | mb_chars provides a multibyte-aware wrapper for strings. It should have no effect on ruby 1.9.3 and above. Although ruby 1.8.7 wouldn't raise errors on a badly sliced multibyte string, on upgrading to ruby 1.9.3 and above, string operations such as gsub, match and join may produce ArgumentErrors with the message "invalid byte sequence in UTF-8". Additionally, a database with 'UTF-8' encoding may produce the error "PG::CharacterNotInRepertoire: ERROR: invalid byte sequence for encoding "UTF8""
* Remove mistakenly committed specGareth Rees2015-05-13-3/+0
| | | | | Mistakenly committed from previous version of da6c11531a761847ee129f92677a44fdb02de04e
* Discard rejected responses with malformed From:Gareth Rees2015-05-13-0/+18
| | | | | | | | | Stops the RequestMailer trying to send a stopped_responses mail if the To: address can’t be parsed from the incoming message. ArgumentError: An SMTP To address is required to send a message. Set the message smtp_envelope_to, to, cc, or bcc address.
* Put emails with malformed To: field in holding penGareth Rees2015-05-13-0/+6
| | | | | Prevents mailin exiting with an error code of 75 and sending error reports to the team@ email address.
* Rescue from Holidays::UnknownRegionErrorhotfix/0.21.0.24Gareth Rees2015-04-29-0/+7
| | | | | If you run an Alaveteli in a region where we can’t show holiday suggestions the holiday import page breaks. This commit rescues from an unavailable region so that we display a friendly error message.
* Remove confusing before blockGareth Rees2015-04-29-4/+11
| | | | | | Next commit adds a new spec; this before block was affecting the behaviour of the new spec. https://robots.thoughtbot.com/lets-not
* Don't redirect to signin on expiration of a non remember-me sessionLouise Crow2015-04-23-1/+0
| | | | In practice, it's just confusing if you've been away from the site.
* Use GET for search forms, not POST.Louise Crow2015-04-10-8/+29
| | | | | | | | | | Now that we use global CSRF authenticity checks, searches were logging logged-in users out as the form is an HTML form, not a Rails-generated form with a CSRF token. So form submission raised an InvalidAuthenticityToken error and reset their session. We could generate the form in Rails, but we also want to minimise the number of non-logged in people who have a session cookie, so that varnish can cache pages extensively. So we don't want to put the CSRF token for the search form in everyone's session.
* Merge branch 'hotfix/0.21.0.6'0.21.0.6Louise Crow2015-04-07-1/+1
|\ | | | | | | | | Conflicts: config/initializers/alaveteli.rb
| * Fix failure to capitalise when non category tag precedes categories.Louise Crow2015-04-07-1/+1
| | | | | | | | Thanks to @RichardTaylor for reporting.
* | Limit the number of pages of requests shown for public bodies.Louise Crow2015-04-07-0/+7
|/ | | | Needs to be restored as part of https://github.com/mysociety/alaveteli/issues/2137.
* Handle the expected case where conversion fails and returns nil.Louise Crow2015-04-02-0/+5
|
* Merge branch 'add-frontpage-autodetect-feed' into rails-3-developLouise Crow2015-03-26-0/+8
|\
| * Add an autodetect feed for the frontpage list of requestsLouise Crow2015-03-19-0/+8
| | | | | | | | Closes Â#434.
* | Merge branch '1472-simpler-external-process-management' into rails-3-developLouise Crow2015-03-24-7/+8
|\ \
| * | Set options via options hash only.Louise Crow2015-03-23-7/+8
| | |
* | | Fix translating Public Body HeadingsGareth Rees2015-03-18-106/+577
| | | | | | | | | | | | | | | Fixes submission of form containing both existing and new translations
* | | Fix translating Public Body CategoriesGareth Rees2015-03-18-136/+763
| | |
* | | Fix translating Public BodiesGareth Rees2015-03-18-298/+432
| |/ |/|
* | Merge branch '59-localised-authority-links' into rails-3-developLouise Crow2015-03-05-108/+93
|\ \ | | | | | | | | | | | | Conflicts: app/views/public_body/show.html.erb
| * | Use routing helper to generate localised urls.Louise Crow2015-03-05-73/+93
| | |
| * | Remove 'html' param.Louise Crow2015-03-05-43/+8
| | | | | | | | | | | | | | | There's only one call to this function in the rest of the code. That has 'html' set to true.
* | | Merge branch 'remove-public-body-categories' into rails-3-developLouise Crow2015-03-05-49/+0
|\ \ \
| * | | Remove deprecated code. Fixes #2015.Louise Crow2015-02-26-49/+0
| |/ /
* | | Exclude .bundle from coverage reports.Louise Crow2015-03-02-0/+1
| | |
* | | Remove specs for charity linksGareth Rees2015-03-02-32/+0
| | | | | | | | | | | | | | | This functionality has been moved to whatdotheyknow-theme: https://github.com/mysociety/whatdotheyknow-theme/commit/963d1453e94056eaf6f93a4f73a1f348a0817656
* | | Fix body/show view spec after rewordingGareth Rees2015-03-02-1/+1
|/ /
* | Fully prevent banned users editing their photoGareth Rees2015-02-24-0/+28
| |
* | Fully prevent banned users editing their about_meGareth Rees2015-02-24-0/+29
| |
* | Add specs to AboutMeValidatorGareth Rees2015-02-24-0/+53
| |
* | Add User#banned?Gareth Rees2015-02-24-0/+18
| | | | | | | | | | | | | | - Redefined User#public_banned? to User#banned? - Add specs for User#banned? - Deprecate User#public_banned? - Replace use of User#public_banned? with User#banned?
* | Merge branch '2134-fix-same-attribute-value-across-locales' into rails-3-developLouise Crow2015-02-23-4/+291
|\ \
| * | Use before methods for object setup, model existing behaviour.Louise Crow2015-02-23-50/+16
| | | | | | | | | | | | | | | Existing behaviour seems to be that when a tag is specified, only bodies that already have that tag will be updated.
| * | Create bodies in before call.Louise Crow2015-02-23-19/+25
| | |