aboutsummaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeLines
* Simple code for the happy pathLouise Crow2013-12-04-0/+8
| | | | | Create the batch and associate new requests with it, send the outgoing messages, and redirect to a page for the new batch.
* Use two bodies in specs.Louise Crow2013-12-04-3/+5
|
* Add InfoRequestBatch model.Louise Crow2013-12-04-0/+25
| | | | | Re-annotate models. Index InfoRequestBatches by user - we'll display the batches for a user when they view their own requests.
* 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
|
* Batch users don't have a daily limit.Louise Crow2013-12-04-0/+7
| | | | | | | It doesn't make logical sense that they would. However I am preserving the ability to make batch requests as a separate thing from not having a daily limit - I think batch sending requires a (perhaps marginally) bigger level of trust.
* Add some specs for existing exceeded_limit? behaviourLouise Crow2013-12-04-0/+24
|
* 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.
* Create a placeholder salutation for a batch request template.Louise Crow2013-12-04-2/+12
|
* Handle the application of censor rules to a batch request template.Louise Crow2013-12-04-0/+6
|
* Add a batch_request_template flagLouise Crow2013-12-04-0/+13
| | | | | | A virtual attribute to use to customise some info request behaviours when we are using one request as a template for creating multiple requests.
* 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/+22
| | | | Make it updatable via the user admin page.
* Merge branch 'move-plugins-out-of-vendor-plugins' into rails-3-developMark Longair2013-12-03-1/+5
|\
| * Move themes from vendor/plugins to lib/themesMark Longair2013-12-03-0/+1
| | | | | | | | | | | | | | | | | | | | These are essentially required in exactly the same way as before, but from lib/themes rather than vendor/plugins. This is the simplest possible change in order make the themes work outside vendor/plugins, I think, but it's not necessarily ideal. It would be worth considering whether these should be changed to Rails engines, as described here: http://guides.rubyonrails.org/engines.html
| * Move acts_as_xapian out of vendor/pluginsMark Longair2013-11-29-1/+2
| | | | | | | | | | This includes making making sure that xapiandbs directory is moved with this version of the code.
| * Move has_tag_string out of vendor/pluginsMark Longair2013-11-29-0/+1
| |
| * Move strip_attributes out of vendor/pluginsMark Longair2013-11-29-0/+1
| |
* | Add timestamps to public_body_translation fixtures.Louise Crow2013-11-29-0/+20
| | | | | | | | | | | | | | | | | | | | 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.
* | Merge remote-tracking branch 'origin/merged-rails-3-2-assset-pipeline' into ↵Louise Crow2013-11-29-90/+2
|\| | | | | | | | | | | | | rails-3-develop Conflicts: Gemfile.lock
| * Merge branch 'feature/rails-3-2-upgrade-spike' into ↵Mark Longair2013-11-29-90/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/switch-to-asset-pipeline Conflicts: Gemfile.lock app/assets/images/admin-theme/ui-bg_flat_0_aaaaaa_40x100.png app/assets/images/admin-theme/ui-bg_flat_55_fbf9ee_40x100.png app/assets/images/admin-theme/ui-bg_flat_65_ffffff_40x100.png app/assets/images/admin-theme/ui-bg_flat_75_cccccc_40x100.png app/assets/images/admin-theme/ui-bg_flat_75_dadada_40x100.png app/assets/images/admin-theme/ui-bg_flat_75_e6e6e6_40x100.png app/assets/images/admin-theme/ui-bg_flat_75_ffffff_40x100.png app/assets/images/admin-theme/ui-bg_inset-soft_95_fef1ec_1x100.png app/assets/images/admin-theme/ui-icons_222222_256x240.png app/assets/images/admin-theme/ui-icons_2e83ff_256x240.png app/assets/images/admin-theme/ui-icons_454545_256x240.png app/assets/images/admin-theme/ui-icons_888888_256x240.png app/assets/images/admin-theme/ui-icons_cd0a0a_256x240.png app/assets/javascripts/admin.js app/assets/javascripts/admin/jquery-ui.min.js app/assets/javascripts/application.js app/assets/javascripts/jquery-ui.min.js app/assets/javascripts/jquery.flot.errorbars.min.js app/assets/javascripts/jquery.flot.min.js app/assets/javascripts/stats.js app/assets/stylesheets/application.css app/assets/stylesheets/fonts.scss app/views/general/_stylesheet_includes.html.erb app/views/layouts/admin.html.erb app/views/layouts/default.html.erb app/views/public_body/statistics.html.erb config/application.rb config/environments/development.rb
| | * Update spec to match upgraded mail gem behaviour.Louise Crow2013-11-12-1/+1
| | | | | | | | | | | | | | | The new name value doesn't escape a double quote within single quotes, which seems more correct.
| | * Remove obsolete test.Louise Crow2013-11-12-88/+0
| | |
| | * Mock methods need to call mail() to generate a proper mail.Louise Crow2013-11-12-1/+1
| | |
* | | Move getting recent requests into a helper method.Louise Crow2013-11-25-42/+37
| | |
* | | Move getting similar requests to the InfoRequest model.Louise Crow2013-11-25-2/+19
|/ /
* | 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
| | |
* | | Add a helper method for temporarily setting I18n.default_localeMark Longair2013-11-19-0/+8
| | | | | | | | | | | | | | | | | | Although the I18n library has an I18n.with_locale helper, there's no equivalent for I18n.default_locale. This method will make a couple of our tests clearer and less brittle.
* | | Insert cookie stripping at correct point in middleware stack.Louise Crow2013-11-18-0/+12
| | |
* | | Session keys are stored as strings in Rails 3.Louise Crow2013-11-18-28/+28
|/ / | | | | | | Update our session-stripping code.
* | 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.
* | | Don't include public bodies tagged 'test' in public body statisticsMark Longair2013-11-07-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the initial release of public body statistics to WhatDoTheyKnow a public body only intended for testing ("mySociety Test Quango") was included in the statistics. This commit causes public bodies tagged with "test" to be excluded from the public body statistics page. Fixes #1115.
* | | 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
| | |
* | | For percentage stats, exclude hidden or unclassified requestsMark Longair2013-11-05-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | The WDTK volunteers pointed out that it's not fair to include hidden requests in the denominator, since they're typically hidden for a good reason (e.g. being vexatious, spam, etc.), and we have no information about those that are awaiting_description (i.e. unclassified) so they should be excluded as well.
* | | Add a info_requests_visible_classified_count column to PublicBodyMark Longair2013-11-05-40/+49
|/ / | | | | | | | | | | 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).
* | Update the helpful model schema annotationsMark Longair2013-11-01-38/+44
| | | | | | | | These are regenerated with "bundle exec annotate"
* | Merge branch 'switch-theme-script' into rails-3-developMark Longair2013-10-30-0/+25
|\ \ | | | | | | | | | | | | Conflicts: config/initializers/alaveteli.rb
| * | Make theme URL to theme name mapping consistentMark Longair2013-10-15-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code that extracted the theme name from each entry in THEME_URLS (in order to require code from a directory whose leaf name is the theme name) only supported git URLs that ended in '.git'. However, the themes:install rake task usefully supports a wider range of git URLs - for example, all of the following were supported: /home/whoever/themes/blah-theme => blah-theme /home/whoever/themes/blah-theme/ => blah-theme git://wherever/blah-theme.git => blah-theme ssh://wherever/blah-theme.git// => blah-theme This commit factors out a theme_url_to_theme_name method, adds tests for it, and uses that method in both: lib/tasks/themes.rake config/initializers/theme_loader.rb ... so that a wider range of theme URLs are consistently supported.
* | | Merge branch 'hotfix/0.14.0.3' into rails-3-developLouise Crow2013-10-24-0/+40
|\ \ \
| * | | Add factory to support new specs.0.14.0.2hotfix/0.14.0.2Louise Crow2013-10-03-0/+7
| | | |