aboutsummaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeLines
* 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
| | |
| * | Don't allow redirects to another host.Louise Crow2013-10-02-0/+33
| | |
| * | Handle salutations with regexp special characters.0.14.0.1Louise Crow2013-09-30-0/+10
| | | | | | | | | | | | Fixes #1104.
* | | Add data to test example given in #1143Louise Crow2013-10-21-11/+16
| |/ |/| | | | | This causes several specs to fail.
* | Merge remote-tracking branch 'origin/fix-aborted-transaction' into ↵Louise Crow2013-10-07-19/+34
|\ \ | | | | | | | | | rails-3-develop
| * | 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.
| * | Factor out a 'with_duplicate_xapian_job_creation' helperMark Longair2013-10-07-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a subsequent commit, we will want to wrap an additional section of code with the addition and removal of a hook that creates a duplicate xapian job, so it's useful for this to be factored out. This commit introduces a 'with_duplicate_xapian_job_creation' method that can be passed a block which will be run with the forced duplicate xapian job creation.
* | | Merge branch 'feature/email-subject-cleanup' into rails-3-developLouise Crow2013-10-07-0/+10
|\ \ \ | |/ / |/| |
| * | Move special case to whatdotheyknow-themeLouise Crow2013-10-04-0/+10
| | | | | | | | | | | | | | | Apart from anything else, we don't want translators to have to worry about the special case text. See https://github.com/mysociety/whatdotheyknow-theme/commit/2078febca5181ce3b1a9c0fae0123ae5f6448718 for the corresponding change to whatdotheyknow-theme.
* | | Fix upcasing of a non-US-ASCII first letter under Ruby 1.8Mark Longair2013-10-04-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | In the rare circumstance that someone created a public body whose name started with a lower case letter outside [a-z] with Alaveteli running under Ruby 1.8, the letter would not be upcased correctly before saving to the first_letter column. This commit fixes that by using a Unicode-aware upcase function.
* | | 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-8/+39
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 '.'.
* | Fix typoLouise Crow2013-09-19-1/+1
| |
* | Handle salutations with regexp special characters.Louise Crow2013-09-19-0/+10
|/ | | | Fixes #1104.
* Remove extra "is invalid" message.Louise Crow2013-09-18-0/+8
| | | | Fixes #1101.
* Merge branch 'hotfix/0.13.0.3' into rails-3-developLouise Crow2013-09-18-0/+37
|\
| * Restrict old_unclassified methods to normal prominence.0.13.0.3hotfix/0.13.0.3Louise Crow2013-09-18-0/+37
| | | | | | | | Fixes #1082.
* | Fix erroneous line break.Louise Crow2013-09-17-2/+1
| |
* | Merge branch 'feature/hide-individual-responses' into rails-3-developLouise Crow2013-09-17-416/+2086
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-7/+7
| | | | | | | | | | | | | | | As @mhl points out, this more clearly indicates that they may come back at some point.
| * | Add message index to attachment filesLouise Crow2013-09-16-3/+3
| | | | | | | | | | | | | | | So that files attached to different messages with the same name and url_part don't get overwritten.
| * | Make test ruby 1.8.7 compatible.Louise Crow2013-09-16-1/+1
| | |
| * | Use earlier factory_girl syntaxLouise Crow2013-09-16-26/+33
| | |
| * | Exclude hidden responses when calculating old_unclassifiedLouise Crow2013-09-16-11/+19
| | | | | | | | | | | | | | | Make old_unclassified_params method consistent with last_public_response_event and associated methods.
| * | Only include public messages in who_can_followup_toLouise Crow2013-09-16-1/+57
| | |
| * | Add public criteria for message event access methodsLouise Crow2013-09-16-60/+120
| | | | | | | | | | | | | | | | | | | | | 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.
| * | Hide hidden outgoing messages in download.Louise Crow2013-09-16-1/+97
| | |
| * | Fix spec descriptionsLouise Crow2013-09-16-2/+2
| | |
| * | Add prominence fields and cache expiry to outgoing adminLouise Crow2013-09-16-13/+95
| | |
| * | InfoRequestEvent.indexed_by_search consults OutgoingMessage.Louise Crow2013-09-16-1/+18
| | |
| * | Move indexed_by_search to MessageProminenceLouise Crow2013-09-16-2/+23
| | | | | | | | | | | | Add some tests that it's working on the outgoing message model.
| * | Add some tests for user_can_view? on outgoing message.Louise Crow2013-09-16-0/+52
| | |
| * | Add hidden messages for outgoing message.Louise Crow2013-09-16-0/+38
| | | | | | | | | | | | | | | | | | Conflicts: app/views/request/_incoming_correspondence.html.erb
| * | Allow creation of multiple public bodies in one test.Louise Crow2013-09-16-2/+4
| | | | | | | | | | | | | | | Add some sequences to make sure that we don't get validation errors on unique fields.
| * | Convert specs to factories from fixtures.Louise Crow2013-09-16-52/+48
| | | | | | | | | | | | | | | | | | Conflicts: spec/integration/view_request_spec.rb
| * | Add a test of incoming message hiding with PDF conversionLouise Crow2013-09-16-0/+59
| | |
| * | Clean up the test download dir after use.Louise Crow2013-09-16-0/+4
| | |
| * | Add expectations for admin and requester.Louise Crow2013-09-16-5/+17
| | |