aboutsummaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeLines
...
| * | Give incoming message a body attachmentLouise Crow2013-09-16-3/+5
| | | | | | | | | | | | By default, give an incoming message a body attachment.
| * | Restore the download for hidden requestsLouise Crow2013-09-16-24/+58
| | | | | | | | | | | | | | | | | | This was disabled for hidden requests as the download was by redirect, allowing people who have not been authenticated to conceivably access the download. We'll be moving to send_file instead, so can restore it.
| * | Fix problem with integration session reuse.Louise Crow2013-09-16-0/+7
| | | | | | | | | | | | | | | The third (and any subsequent) session created shares a session id with the second without this explicit reset.
| * | Make absence of htmltopdf converter more explicit.Louise Crow2013-09-16-47/+52
| | | | | | | | | | | | We're testing the code path where there is no converter here.
| * | Make external request download spec more specific.Louise Crow2013-09-16-4/+5
| | |
| * | Remove hidden incoming messages from correspondence.txtLouise Crow2013-09-16-0/+34
| | | | | | | | | | | | | | | | | | | | | Adds a spec for what we want to see - no message text in correspondence.txt, and no attachments. Refactors the simple_correspondence templates to make it clearer that these are doing the same job as the html.erb ones, for text.
| * | Split up translated messages.Louise Crow2013-09-16-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Each part is a separate sentence, and we're going to reuse some of them in the text view. Conflicts: spec/integration/view_request_spec.rb
| * | Give incoming message factory a body text.Louise Crow2013-09-16-9/+21
| | | | | | | | | | | | Also, store an event for the incoming message.
| * | Rewrite download specLouise Crow2013-09-16-47/+76
| | | | | | | | | | | | | | | Make it an integration spec so we don't need to touch the internals so much.
| * | Allow an actual user to be passed to the login method.Louise Crow2013-09-16-1/+5
| | |
| * | Replace fixture-based spec with factory-based equivalent.Louise Crow2013-09-16-10/+6
| | |
| * | Use expectation for hidden responses more generally.Louise Crow2013-09-16-9/+9
| | |
| * | Fix request in spec for hidden attachments not being viewed.Louise Crow2013-09-16-2/+15
| | | | | | | | | | | | | | | Add another spec for the same behaviour when an incoming message is hidden.
| * | Add new code and specs for hiding attachments.Louise Crow2013-09-16-1/+106
| | |
| * | Refactor expectation into a methodLouise Crow2013-09-16-6/+8
| | | | | | | | | | | | Remove expectation of pdf contents - we're looking at the raw file.
| * | Use a real pdf file for foi_attachment factory.Louise Crow2013-09-16-2/+2
| | |
| * | Refactor prominence specs to use factories not fixtures.Louise Crow2013-09-16-117/+133
| | |
| * | Clarify specs.Louise Crow2013-09-16-5/+5
| | | | | | | | | | | | They refer to the case where the request itself is hidden.
| * | Add the meat of the update action.Louise Crow2013-09-16-0/+70
| | |
| * | Add a simple edit action and templateLouise Crow2013-09-16-5/+28
| | |
| * | Make some simple factories for real objects.Louise Crow2013-09-16-0/+33
| | |
| * | Shorter route names and pathsLouise Crow2013-09-16-2/+2
| | |
| * | Slightly nicer action names.Louise Crow2013-09-16-5/+5
| | |
| * | Move incoming message admin to its own controller.Louise Crow2013-09-16-76/+106
| | | | | | | | | | | | | | | Make specs that depend on multiple controllers and models interacting integration specs.
| * | Move outgoing message admin actions to their own controller.Louise Crow2013-09-16-12/+23
| | | | | | | | | | | | Eventually this should use standard RESTful routing.
| * | Don't index hidden and requester_only incoming messages.Louise Crow2013-09-16-0/+64
| | |
| * | Add prominence reason.Louise Crow2013-09-16-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: app/views/request/_incoming_correspondence.html.erb Conflicts: spec/integration/view_request_spec.rb
| * | Adding prominence_reason to IncomingMessage.Louise Crow2013-09-16-0/+2
| | |
| * | Add messages for hidden and requester_only states.Louise Crow2013-09-16-4/+93
| | | | | | | | | | | | Different messages for normal user, requester and admin user.
| * | Refactor some common setup steps in integration tests into a DSL.Louise Crow2013-09-16-60/+114
| | | | | | | | | | | | Add a failing test for what should happen on request hiding.
| * | Refactor common logic about prominence and access.Louise Crow2013-09-16-1/+1
| | | | | | | | | | | | Move it into the Ability module.
| * | Add a method to ask whether a user can view an incoming message.Louise Crow2013-09-16-0/+57
| | |
| * | Add response_event helperLouise Crow2013-09-16-0/+12
| | | | | | | | | | | | | | | Add a convenience method for getting the 'response' event associated with an incoming message.
| * | Add prominence to incoming message.Louise Crow2013-09-16-0/+22
| | |
| * | Re-annotate models with database fieldsLouise Crow2013-09-16-0/+437
| | |
| * | Remove prominence.Louise Crow2013-09-16-12/+0
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'feature/issue-902-fix' into rails-3-developLouise Crow2013-09-17-0/+22
|\ \ \
| * | | Allow a unicode-only title in validationLouise Crow2013-09-17-0/+22
| | | |
* | | | Merge branch 'feature/issue-555-fix' into rails-3-developLouise Crow2013-09-17-0/+31
|\ \ \ \
| * | | | Add a failing spec for handling a race conditionLouise Crow2013-09-17-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spec uses a hook method to simulate the insertion of an acts_as_xapian_job in another process for the model. Credit to: http://stackoverflow.com/questions/2017587/simulating-race-conditions-in-rspec-unit-tests Conflicts: vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb
* | | | | Merge branch 'public-body-locale-fallback' into rails-3-developLouise Crow2013-09-12-8/+66
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | Conflicts: app/controllers/public_body_controller.rb config/general.yml-example lib/configuration.rb
| * | | | Don't display duplicate public bodies with the fallbackMark Longair2013-09-12-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces some raw SQL statement for the fallback case, but we can't see an easy way to avoid that in this case. This commit also adds some tests that assert the sorting and non-duplication properties of the listing. Thanks to Louise Crow for working out the SQL expression for falling back to the default locale.
| * | | | Factor out the code to generate example single language public bodiesMark Longair2013-09-10-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | | It's useful to be able to generate example public bodies that only have translations in particular languages.
| * | | | Add tests to assert the new public body listing behaviourMark Longair2013-09-10-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests will fail unless we have the new behaviour for public body listing, which depend on the setting of PUBLIC_BODY_LIST_FALLBACK_TO_DEFAULT_LOCALE.
| * | | | Make falling back to default locale in public body listings optionalMark Longair2013-09-10-1/+8
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the code stood, the list method in PublicBodyController would only return results that had translations of the public body in the default locale. This has a variety of problems if you're viewing pages in the non-default locale - for example, the "first letter" links wouldn't bring up the public bodies that began with that letter in the current locale, only those that began with it in the default locale. Ideally, every public body would be translated into every available locale for the site, but there are cases where deployers wish to have public body listings also include those from the default locale, in case there are untralsated public bodies: https://groups.google.com/d/msg/alaveteli-dev/zUY_USaAMAM/M7KTQ9RC5YUJ This commit makes the default behaviour to look for public body listings only in the current locale, but if the new configuration option PUBLIC_BODY_LIST_FALLBACK_TO_DEFAULT_LOCALE is set, then public body listings will be looked for in both the current locale and the default locale. Fixes #1000
* | | | Save cached columns once updated.Louise Crow2013-09-05-2/+7
| | | |
* | | | Don't dirty every attribute in checking for whitespace.Louise Crow2013-09-05-15/+31
| |/ / |/| | | | | | | | | | | | | | | | | Check to see if the stripped version is different before setting it on the record. If we don't do this, the subsequent call to write_attribute in Globalize3 which uses attribute_will_change! means we're storing versions when there hasn't really been any change.
* | | Add a config option to enable the public body statistics pageMark Longair2013-08-20-0/+1
| | |
* | | Improve calculation of PublicBody statistics columnsMark Longair2013-08-20-1/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On PublicBody, we don't need to update info_requests_count because that's already done with :counter_cache. On the other hand, info_requests_successful_count and info_requests_not_held_count can't be updated easily with counter_cache (since they need conditions to be attached). Instead we update them in post_save and post_destroy, as suggested here: http://blog.douglasfshearer.com/post/17495285851/custom-counter-cache-with-conditions This also adds tests to ensure that the after_(save|destroy) callbacks are called and that they modify the counts correctly.
* | | Add a test for the PublicBodyController statistics actionMark Longair2013-08-20-0/+52
| | |