| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
Previously the call to public_body.send would return the value for
the default locale if no value was set in the current locale,
meaning that translations for attributes that were the same as
the attribute values in the default locale were not being loaded.
Fixes #2134.
|
|\ |
|
| | |
|
| | |
|
|/ |
|
| |
|
|
|
|
|
| |
Filters on `latest_status` because filtering by `status` searches all
states a request has ever been in.
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Extracts the attachment processing from FoiAttachment#body_to_html
AttachmentToHTML contains adapters which convert
- text/plain
- application/pdf
- application/rtf
Results are returned as an AttachmentHTML::HTML instance which contains
the raw HTML and other metadata about the conversion.
|
|/
|
|
|
| |
Should have been run after related migrations.
Could automate this to always run after migrations.
|
|
|
|
|
|
|
| |
We already handled this type of quoting when coming directly from a text
part of a mail, but when we choose the HTML part as the main part and
then convert it to text, the 'On [date] <email> person said:' part can
get split over two lines.
|
|
|
|
|
|
|
| |
Just expecting the parsed file to include the expected one would mean
success in the case where nothing has been folded. Tighten up the
expectation, and add quoting placeholders to expected files that didn't
have them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a fix for issue #1232. Richard Taylor pointed
out that some PDF attachments had the non-standard content-type
document/pdf, and that these weren't being treated as PDFs.
(Ganesh Sittampalam discovered that all of these PDFs were
generated by a Lexmark X945e, according to the PDF metadata.)
This commit adds an extra case to normalise_content_type to map
document/pdf to application/pdf.
In fact, since the upgrade of the Mail gem in ccebe3c3d6d4dc5f81
the behaviour when handling the non-standard content-type
document/pdf was much better, but this commit also means that
you get the right icon for the attachment, and can be
cherry-picked onto older versions to fix #1232.
|
|
|
|
|
|
|
|
|
|
| |
Between rails 3.2.0 and 4.0.1rc4, timestamps were constrained to be
non-null. As globalize creates the public_body_translation table with
timestamps, this means there are errors in the tests when trying to
insert the fixture data, which doesn't have timestamps. These errors
were only appearing on Travis because locally the test database is
cloned from the development structure rather than being created by
running the migrations.
|
|
|
|
|
|
| |
This counts only those info requests that have prominence 'normal'
(i.e. are not hidden) and are not 'awaiting_description' (i.e. that
they have had some basic status classification).
|
|
|
|
| |
These are regenerated with "bundle exec annotate"
|
|
|
|
| |
This causes several specs to fail.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a public body called "Åčçèñtéd Authority" in the
Czech locale (cs) so that we can create tests that exercise,
for example, searching based on an initial letter that has a
multi-byte representation in UTF-8.
An old test for "add mass tags" in the admin needed to be updated
since it implicitly assumed that all the public bodies in the
fixtures had translations in the :en locale.
The tests for loading CSV files of public bodies also needed to
be updated, since they were assuming that public body names
only contained letters in [A-Za-z ]. Since Unicode character
classes aren't easily available in Ruby 1.8 and it makes little
difference to the test, the character class is replaced by '.'.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
Gemfile
app/views/admin_request/edit_outgoing.html.erb
config/packages
doc/CHANGES.md
doc/INSTALL.md
spec/models/info_request_spec.rb
spec/models/public_body_spec.rb
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Add a migration to remove the unused column 'prominence' from
info_request_events, remove validation of prominence, remove unused
InfoRequestEvent.user_can_view? method. Remove references to
InfoRequestEvent.prominence.
|
| | |
|
|/ |
|
|
|
|
| |
118n.locale in the handling of locales with underscores. Fixes #999.
|
| |
|
|
|
|
| |
expire the template cache and trigger a lookup.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This seems to be the bug mentioned here:
http://po-ru.com/diary/fixing-invalid-utf-8-in-ruby-revisited/
That explains that some versions of Iconv don't ignore
invalid characters when converting to UTF-8 even with
//IGNORE if that invalid character happens to be at the end
of the string. In fact, as Matthew Somerville pointed out,
with some versions of iconv (e.g. 1.14 on Mac OS, apparently)
it's necessary to add and remove more than one space at the end,
in case the first character of the byte sequence indicates a
long sequence. We add and remove 4 to be on the safe side.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes 'hello.txt' to 'hello-world.txt' in the
incoming-request-two-same-name.email fixture. The reasoning
for this change is that if there are no special characters in
the filename then filename and display_filename will be the
same and the tests won't pick up any confusion between the
two.
The test requests to :get_attachment and
:get_attachment_as_html should get the display_filename rather
than filename.
|
|
|
|
|
|
|
|
|
|
| |
The behaviour of the TMail backend's 'to' and 'cc' methods
where there was a malformed To: or Cc: line was to return
nil, whereas Mail returns a version of the string anyway.
We'd have to change quite a lot of code to deal with an
extra possible class of returned objects, so it's simplest
for the moment to monkey-patch Mail::Message's 'to' and 'cc'
methods to restore the old behaviour.
|
|
|
|
|
|
|
|
|
|
|
| |
Under Rails 3, the uudecoded FoiAttachment in this test
fails validation at the self.save! in
IncomingMessage.parse_raw_email, although the FoiAttachment
has been correctly created and saved to the database in
_uudecode_and_save_attachments. Forcing a reload=true on
self.foi_attachments fixes this.
Thanks to Louise Crow for finding the fix for this problem.
|
|
|
|
| |
no charset field.
|
|
|
|
|
|
|
|
|
|
|
| |
The example file that was used for checking for text
attachment data which could not be converted to UTF-8 is
one that we *can* actually deal with by guessing the
character set, since it's valid GB18030. So, this commit
changes that test to check for the first few Chinese
characters in that email, and introduces a replacement
test with text from /dev/random, which should not be
interpretable in any sensible way.
|
|
|
|
|
|
|
| |
This example email indicates the wrong charset and includes
a top bit set character despite Content-Transfer-Encoding: 7bit
- nonetheless, we should be able to convert it to UTF-8 and
interpret the character correctly.
|
|
|
|
|
|
|
|
|
| |
If there is a missing final MIME boundary, the behaviour
of Alaveteli with the TMail backend was to still parse
the attachment, but with the new code it currently throws
an exception. This commit adds a test that asserts that
the attachment should be parsed despite the email being
malformed in this way.
|
|
|
|
|
|
|
|
|
|
|
| |
There is currently a difference in behaviour in the parsing
of nested MIME multipart attachments between the Mail and
TMail based backends. This commit adds a test that will
pass if the behaviour is the same as the the old (TMail-based)
version, which I believe is correct according to RFC 1521.
The example email has a PNG attachment after the final MIME
boundary, and the RFC says that anything after the final
boundary ("the epilogue") should be ignored.
|
|
|
|
|
|
|
|
|
|
|
| |
These two cases were ignored previously, and we need to make sure
that they still are under the switch from TMail to Mail.
One TNEF attachment is a heavily truncated one from a real example
from Alaveteli that has no personal data in it. The other is
an example from the tests in the distribution of the tnef
package for Ubuntu 1.4.9-1 - it's an HTML version of the US
constitution.
|
|
|
|
| |
non-standard require - bundler should be supplying the gem now.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
Gemfile.lock
app/controllers/public_body_controller.rb
app/mailers/track_mailer.rb
app/views/request/_hidden_correspondence.html.erb
app/views/request/_sidebar.html.erb
app/views/request/hidden.html.erb
app/views/request/new_please_describe.html.erb
app/views/request/preview.html.erb
app/views/user/show.html.erb
config/environment.rb
config/routes.rb
spec/controllers/public_body_controller_spec.rb
|
| | |
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
app/models/outgoing_message.rb
app/views/general/search.rhtml
app/views/public_body/list.rhtml
app/views/public_body/show.rhtml
app/views/public_body/view_email.rhtml
app/views/request/_after_actions.rhtml
app/views/request/_followup.rhtml
app/views/request/_sidebar.rhtml
app/views/request/new.rhtml
app/views/request/select_authority.rhtml
app/views/request/upload_response.rhtml
locale/aln/app.po
locale/app.pot
locale/ar/app.po
locale/bs/app.po
locale/ca/app.po
locale/cs/app.po
locale/cy/app.po
locale/de/app.po
locale/en/app.po
locale/en_IE/app.po
locale/es/app.po
locale/eu/app.po
locale/fr/app.po
locale/gl/app.po
locale/hu_HU/app.po
locale/id/app.po
locale/nb_NO/app.po
locale/pt_BR/app.po
locale/ro_RO/app.po
locale/sl/app.po
locale/sq/app.po
locale/sr@latin/app.po
locale/tr/app.po
locale/uk/app.po
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
locale/eu/app.po
locale/sq/app.po
|
| | | |
|
| | | |
|