aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
Commit message (Collapse)AuthorAgeLines
...
| * Use two bodies in specs.Louise Crow2013-12-04-3/+5
| |
| * Handle a banned user making batch requests.Louise Crow2013-12-04-0/+15
| |
| * Factor out common params for clarity.Louise Crow2013-12-04-18/+11
| |
| * Require at least one public body in the params.Louise Crow2013-12-04-2/+10
| |
| * Create template and outgoing messageLouise Crow2013-12-04-0/+29
| | | | | | | | | | Add validation, preview as in single request creation. Add comments noting further work to be done in this action.
| * Add new_batch actionLouise Crow2013-12-04-0/+66
| | | | | | | | | | | | Give it basic access control, and add some conditionals to the 'new' template around bits that use @info_request.public_body so that they render something different if @batch is assigned.
| * Add template for select_authoritiesLouise Crow2013-12-04-2/+32
| | | | | | | | Should retain a list of selected public bodies across searches.
| * Handle not enabled, no user, unauthorised user.Louise Crow2013-12-04-3/+55
| |
| * Add a select_authorities action.Louise Crow2013-12-04-0/+9
| |
| * Add a can_make_batch_requests flag to user modelLouise Crow2013-12-04-2/+21
| | | | | | | | Make it updatable via the user admin page.
* | Merge branch 'hotfix/0.16.0.6' into rails-3-developLouise Crow2014-01-28-0/+12
|\ \
| * | Handle a request with no user in the show request function0.16.0.5hotfix/0.16.0.5Louise Crow2014-01-28-0/+12
| | |
* | | Merge branch 'feature/1176-automate-authority-contacts' into rails-3-developLouise Crow2014-01-28-166/+427
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: doc/CHANGES.md
| * | | Add admin urls to change request emailsLouise Crow2014-01-13-0/+4
| | | |
| * | | Add form for closing change request without actionLouise Crow2014-01-13-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | For cases where we don't want to make the change suggested. There doesn't seem to be any obvious default text to use in the response to the person who requested the change.
| * | | Populate admin public body forms based on a change request.Louise Crow2014-01-13-0/+106
| | | | | | | | | | | | | | | | | | | | Also add editable text for an email to be sent to the person requesting the change.
| * | | Reorganise specsLouise Crow2014-01-13-166/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to make it clearer where to add new specs, group specs by controller and action, merging specs relating to internationalisation with other specs as there seem to be no specific prerequisites in terms of set up for them, and removing some duplicate specs.
| * | | Form and models for asking for a public body change.Louise Crow2014-01-13-0/+95
| | | |
* | | | Merge branch 'feature/cache-request-lists' into rails-3-developLouise Crow2014-01-28-86/+0
|\ \ \ \
| * | | | Cache frequently accessed request lists.Louise Crow2013-12-19-86/+0
| |/ / / | | | | | | | | | | | | Make specs a bit more focused, remove view specs - they're not relevant to the new code in their current form and don't seem to merit updating.
* | / / Tighten up expectation, make expected files consistent.Louise Crow2014-01-17-12/+0
| |/ / |/| | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'feature/cleanup-popups' into release/0.16Louise Crow2014-01-14-1/+1
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | Conflicts: Gemfile.lock app/views/layouts/default.html.erb config/application.rb public/admin/stylesheets/admin.css
| * | Cleanup popup notices.Louise Crow2014-01-14-1/+1
| |/ | | | | | | | | | | | | | | Move HTML to view from controller, use same elements for other country popup and everypage - partly so they don't display on top of each other anymore. Don't position them over existing content, position them at the top of the page. Use consistent styling, and keep the javascript unobtrusive.
* / Only show the blog if a BLOG_FEED is configured.Louise Crow2013-12-09-0/+11
|/
* Move getting recent requests into a helper method.Louise Crow2013-11-25-42/+0
|
* Merge branch 'all-authorities-reduce-memory' into rails-3-developMark Longair2013-11-19-0/+14
|\ | | | | | | | | This has already been cherry-picked into the wdtk branch, but it should also be merged into rails-3-develop
| * Reduce the memory used to serve /body/all-authorities.csvMark Longair2013-11-14-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On WDTK, /body/all-authorities was using lots of memory - this commit reduces that by (a) fetching the public bodies in batches, rather than keeping them all in memory at one time and (b) writing the CSV to a file and then returning it with X-Sendfile (or equivalent), rather than returning the whole file from memory with send_data. There's a FIXME to do with the layout of download directories; if that's changed, the example nginx config, etc. will need to be updated too. This commit also adds a basic test for reasonable CSV being returned and switches from FasterCSV to CSV in order to fix this NotImplementedError under Ruby 1.9: Please switch to Ruby 1.9's standard CSV library. It's FasterCSV plus support for Ruby 1.9's m17n encoding engine. (The CSV version seems to still work fine under 1.8.7.)
* | Fix construction of example public bodies for upstream globalizeMark Longair2013-11-19-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're trying to switch to an upstream version of globalize, which now has Henare's change to allowed blank values without them being converted to nil - however, there is another intermediate change that was introduced which means that the name is only written back to the original table if the locale matches the default locale. This is described in more depth here: https://github.com/globalize/globalize/pull/183 This change broke the make_single_language_example helper, but this commit fixes that by also setting the default locale before creating the example public bodies.
* | Refactor some tests to use with_default_localeMark Longair2013-11-19-17/+15
|/
* Merge branch 'feature/1118-fix-ask-us-to-add-links' into rails-3-developMark Longair2013-11-07-0/+16
|\
| * Show 'browse all' and 'ask us to add' one for authority only search.Louise Crow2013-11-07-0/+5
| | | | | | | | | | This is for the case where there are no results and the user was explicitly searching for authorities.
| * Show highlights and correction regardless of search type.Louise Crow2013-11-07-0/+11
| | | | | | | | Contributes to #1118.
* | Factor out code for generating graphable data and add testsMark Longair2013-11-05-0/+87
| | | | | | | | | | | | This simplifies the statistics action of the PublicBodyController and makes it easier to test the functionality now in the simplify_stats_for_graphs method.
* | Fix the indentation of a PublicBodyController testMark Longair2013-11-05-28/+28
|/
* Merge branch 'hotfix/0.14.0.3' into rails-3-developLouise Crow2013-10-24-0/+33
|\
| * Don't allow redirects to another host.Louise Crow2013-10-02-0/+33
| |
* | Fix for an aborted transaction not being rolled-backMark Longair2013-10-07-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were seeing errors in xapian_create_job that indicated that the current transaction had been aborted but not rolled-back. It seems that this happened because sometimes xapian_create_job was called from within another transaction (e.g. from the transaction block in AdminIncomingMessageController#redeliver). The default behaviour of nested transactions in Rails is for them to behave as if all but the outermost transaction blocks had no effect; this means that the exception thrown in the inner transaction block in xapian_create_job wasn't causing a rollback, and it was then being caught before propagating up to the outermost transaction. Thus the transaction was never being rolled-back so any subsequent operation on this database connection would error. This commit fixes this problem by using the :requires_new => true option to transaction, which asks ActiveRecord to fake genuinely nested transcations using SAVEPOINT. Fixes #1124.
* | Allow public body listing based on first letter outside US-ASCIIMark Longair2013-10-04-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Under Ruby 1.8, it was previously impossible to use one of the "first letter" alphabet links on the public body listing page if the first letter was outside [A-Za-z] since the test for the parameter only being a single letter wasn't aware of the possibly of multi-byte characters. In addition, upcasing of letters outside [A-Za-z] didn't work because String#upcase in Ruby 1.8 isn't Unicode-aware. This commit fixes these two problems, so that non-US-ASCII first letter links will work under Ruby 1.8. (Fixes #1112.)
* | Add to fixtures a public body with an accented initial letterMark Longair2013-10-04-1/+2
|/ | | | | | | | | | | | | | | | | 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 '.'.
* Remove extra "is invalid" message.Louise Crow2013-09-18-0/+8
| | | | Fixes #1101.
* Fix erroneous line break.Louise Crow2013-09-17-2/+1
|
* Merge branch 'feature/hide-individual-responses' into rails-3-developLouise Crow2013-09-17-261/+453
|\ | | | | | | | | | | | | | | | | | | | | 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
| * Use 403, not 410, for hidden items.Louise Crow2013-09-16-4/+4
| | | | | | | | | | As @mhl points out, this more clearly indicates that they may come back at some point.
| * Use earlier factory_girl syntaxLouise Crow2013-09-16-5/+7
| |
| * Add public criteria for message event access methodsLouise Crow2013-09-16-9/+10
| | | | | | | | | | | | | | get_last_response_event and get_last_outgoing_event are used in various places to determine which events to link to, use in queries etc. Restrict them to refer to the last publicly visible event of the relevant type, and rename them to make that clear.
| * Fix spec descriptionsLouise Crow2013-09-16-2/+2
| |
| * Add prominence fields and cache expiry to outgoing adminLouise Crow2013-09-16-13/+95
| |
| * Restore the download for hidden requestsLouise Crow2013-09-16-6/+0
| | | | | | | | | | | | 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.
| * Rewrite download specLouise Crow2013-09-16-45/+3
| | | | | | | | | | Make it an integration spec so we don't need to touch the internals so much.
| * Replace fixture-based spec with factory-based equivalent.Louise Crow2013-09-16-10/+6
| |