aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib
Commit message (Collapse)AuthorAgeLines
...
* Add a test for parsing a malformed emailMark Longair2013-05-16-0/+15
| | | | | | | 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.
* Add a test for a missing final MIME boundaryMark Longair2013-05-16-0/+9
| | | | | | | | | 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.
* Add a test to check that anything in the MIME epilogue is ignoredMark Longair2013-05-16-0/+11
| | | | | | | | | | | 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.
* Add tests for TNEF attachments that should be handledMark Longair2013-05-16-0/+24
| | | | | | | | | | | 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.
* Merge branch 'release/0.9' into rails-3-developLouise Crow2013-04-24-0/+28
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Merge branch 'feature/final-consistent-translation-interpolation' into developLouise Crow2013-04-16-0/+28
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Override n_ to add interpolationMatthew Landauer2013-04-09-0/+28
| | |
* | | Merge remote-tracking branch 'mysociety/develop' into rails-3-developHenare Degan2013-03-14-0/+51
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Gemfile Gemfile.lock app/controllers/admin_request_controller.rb app/controllers/admin_track_controller.rb app/controllers/request_controller.rb app/controllers/services_controller.rb app/helpers/link_to_helper.rb app/mailers/request_mailer.rb app/models/application_mailer.rb app/models/info_request.rb app/views/admin_censor_rule/edit.html.erb app/views/admin_censor_rule/new.html.erb app/views/admin_public_body/_form.html.erb app/views/admin_public_body/_locale_selector.html.erb app/views/admin_public_body/_one_list.html.erb app/views/admin_public_body/edit.html.erb app/views/admin_public_body/list.html.erb app/views/admin_public_body/new.html.erb app/views/admin_request/_incoming_message_actions.html.erb app/views/admin_request/edit.html.erb app/views/admin_request/edit_comment.html.erb app/views/admin_request/edit_outgoing.html.erb app/views/admin_request/list.html.erb app/views/admin_request/list_old_unclassified.html.erb app/views/admin_request/show.html.erb app/views/admin_track/_some_tracks.html.erb app/views/admin_track/list.html.erb app/views/admin_user/edit.html.erb app/views/admin_user/list.html.erb app/views/admin_user/show.html.erb app/views/general/_footer.html.erb app/views/general/exception_caught.html.erb app/views/help/contact.html.erb app/views/layouts/default.html.erb app/views/public_body/_alphabet.html.erb app/views/request/_request_listing_single.html.erb app/views/request/_sidebar.html.erb app/views/request/new.html.erb app/views/request/show.html.erb app/views/request_mailer/external_response.rhtml app/views/request_mailer/fake_response.rhtml config/environment.rb config/environments/production.rb config/routes.rb spec/controllers/admin_censor_rule_controller_spec.rb spec/controllers/request_controller_spec.rb spec/controllers/track_controller_spec.rb spec/helpers/link_to_helper_spec.rb spec/mailers/request_mailer_spec.rb spec/models/info_request_spec.rb spec/spec_helper.rb spec/views/public_body/show.html.erb_spec.rb spec/views/request/show.html.erb_spec.rb vendor/plugins/rails_xss/lib/rails_xss/erubis.rb
| * | Add tests for Ability.can_update_request_state?Matthew Landauer2013-03-03-0/+51
| | |
| * | Merge remote-tracking branch ↵Louise Crow2013-02-01-13/+8
| |\ \ | | | | | | | | | | | | 'openaustralia_github/backport_timezone_spec_rails_3_fix' into develop
| | * | read_attribute does timezone conversion in rails 3. So using ↵Matthew Landauer2013-01-25-13/+8
| | |/ | | | | | | | | | attributes_before_type_cast instead
| * / Rename mailer method to avoid naming conflict in Rails 3Matthew Landauer2013-01-25-2/+2
| |/
* | Update to new mail sending APIHenare Degan2013-02-25-4/+4
| |
* | Replace use of have_text with contain from webrat or matchMatthew Landauer2013-01-29-1/+1
| |
* | Merge branch 'rails_xss' into rails-3-spikeMatthew Landauer2013-01-25-0/+38
|\| | | | | | | | | | | | | | | Conflicts: Gemfile Gemfile.lock config/environment.rb lib/i18n_fixes.rb
| * Merge remote-tracking branch 'mysociety/develop' into rails_xssMatthew Landauer2013-01-15-20/+365
| |\
| * | Fix translations with interpolations to correctly handle safe_htmlMatthew Landauer2013-01-15-0/+38
| | |
* | | In rails 3 sendmail is passed the destination of the email on the ↵Matthew Landauer2013-01-25-1/+6
| | | | | | | | | | | | commandline. Also, monkeypatch not needed anymore
* | | Rename mailer method to avoid naming conflict in Rails 3Matthew Landauer2013-01-25-2/+2
| | |
* | | Remove timezone monkeypatch fixes because they're not necessary in Rails 3 ↵Matthew Landauer2013-01-25-0/+5
| | | | | | | | | | | | anymore
* | | read_attribute does timezone conversion in rails 3. So using ↵Matthew Landauer2013-01-25-13/+8
| |/ |/| | | | | attributes_before_type_cast instead
* | Wrap specs on the extraction of RFC-822 headers in code that sets the ENV ↵Louise Crow2012-12-11-26/+14
| | | | | | | | timezone. TMail renders headers using localtime, which is not ideal, but we're migrating away from it anyway, so I'm not sure it's worth delving into the internals of TMail to fix it.
* | Add specs for attachment attributes.Louise Crow2012-12-06-0/+20
| |
* | Add a spec for some basic consistency in content types, url part numbers, ↵Louise Crow2012-12-06-0/+80
| | | | | | | | filenames, and within rfc822 subjects.
* | Convert example URL to spec.Louise Crow2012-12-06-0/+9
| |
* | Stub the close method on the object we're passing to the zip file extraction ↵Louise Crow2012-12-06-1/+3
| | | | | | | | function.
* | Rename _get_attachment_text_internal_one_file to ↵Louise Crow2012-12-06-3/+2
| | | | | | | | get_attachment_text_one_file as it is now an externally-accessed method of the mail handler module.
* | Move methods for getting the text out of attachments to the mail handler module.Louise Crow2012-12-06-1/+21
| |
* | Adding methods for getting the content type of a mail part, and getting ↵Louise Crow2012-12-04-0/+54
| | | | | | | | header strings from a mail.
* | Rewrite and move spec so that it tests the mail handler method.Louise Crow2012-12-04-0/+7
| |
* | Removing obsolete comment - doesn't apply to this spec.Louise Crow2012-12-04-3/+0
| |
* | Add specs for getting name, email and formatted address - make them pass ↵Louise Crow2012-12-04-0/+50
| | | | | | | | with the mail backend.
* | Add a method for setting the from address on a plain email fixture.Louise Crow2012-12-04-6/+8
| |
* | Add methods for finding out if there is an empty return path on a mail and ↵Louise Crow2012-12-04-0/+32
| | | | | | | | getting the auto-submitted field.
* | Move method for getting the to, cc and envelope-to addresses of a mail to ↵Louise Crow2012-12-04-0/+29
| | | | | | | | the mail handler.
* | Add specs for the mail handler getting the from name and from address from ↵Louise Crow2012-12-03-0/+56
| | | | | | | | an email.
* | Use get_part_body in spec.Louise Crow2012-12-03-1/+1
|/
* Move TMail extensions to mail handler.Louise Crow2012-11-15-45/+11
|
* Factor out method for getting a mail object from a fixture file.Louise Crow2012-11-15-4/+0
|
* Move TMail monkey patch to MailHandler Tmail backend.Louise Crow2012-11-15-0/+16
|
* Fix failing timezone specs. As we are now setting a value for timezone in ↵Louise Crow2012-10-25-8/+40
| | | | | | config.timezone, this switches on ActiveRecord::time_zone_aware_attributes, so values are returned in the time zone specified (although still saved in whatever is specified in ActiveRecord.default_timezone in the db - in our case UTC). Previously with no timezone set, values would have been returned in UTC. So add some lines to look at the zone the data is saved in before the time_zone_aware_attributes kick in, and some lines to look at the values afterwards. Note that expected raw_saved time values are the same as the previous expected values for saved time (when there was no attribute time zone awareness), but that the time zone of values coming back on the model is set by config.time_zone and then overridden by Time.use_zone.
* Fix spec - based on the spec description, what's being tested and the other ↵Louise Crow2012-10-25-12/+12
| | | | specs, I assume that the activerecord default timezone is supposed to be set to :local as a precondition. Doing so makes the spec pass and make sense.
* Rename models and tables exim -> mail_serverMatthew Landauer2012-10-11-9/+9
|
* Add headings and by_heading accessors to PublicBodyCategories to allow ↵Louise Crow2012-08-28-0/+42
| | | | easier access to headings and to tags associated with a particular heading.
* Load all fixtures for all testsRobin Houston2012-01-31-1/+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.
* Improve test isolationRobin Houston2012-01-24-0/+1
| | | | Another brick in the wall (#361)
* Improve test isolationRobin Houston2012-01-12-0/+5
| | | | | I was seeing some test failures, apparently caused by inadequate test isolation. This change fixed them.
* Merge remote-tracking branch 'jpmckinney/pre1.9' into developSeb Bacon2011-11-24-0/+1
|\ | | | | | | | | Conflicts: spec/controllers/request_controller_spec.rb
| * add encoding magic comments and fix pathsJames McKinney2011-10-16-0/+1
| |
* | allow specs to run independentlyJames McKinney2011-10-16-1/+1
|/