aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
Commit message (Collapse)AuthorAgeLines
* Validate the presence of the description.Louise Crow2014-12-01-0/+6
| | | | It's required in [PublicBody#type_of_authority]( https://github.com/mysociety/alaveteli/blob/rails-3-develop/app/models/public_body.rb#L343-L347)
* Add ChangeEmailValidator specGareth Rees2014-10-29-0/+124
|
* Merge branch 'issues/1778-send-message' into rails-3-developGareth Rees2014-10-17-4/+7
|\
| * Remove now-unused OutgoingMessage#send_messageGareth Rees2014-10-17-4/+7
| | | | | | | | Models should not send emails
* | Require heading and category in PublicBodyCategoryLink.Louise Crow2014-10-09-0/+12
| | | | | | | | Update default factory accordingly.
* | fixup! Remove old PublicBodyCategories calls.Louise Crow2014-10-09-1/+1
| |
* | Remove old PublicBodyCategories calls.Louise Crow2014-10-09-1/+1
| | | | | | | | | | Add deprecation notice to draw attention to any place where PublicBodyCategories is called from themes.
* | Don't migrate categories automatically.Louise Crow2014-09-26-10/+0
| | | | | | | | | | It becomes confusing in the test environment, better to have a clean script.
* | Don't require a category descriptionLouise Crow2014-09-26-0/+20
| | | | | | | | | | Some existing themes don't use one for categories like 'misc' and that seems reasonable usage. Add some specs for the things we do validate.
* | Create module to clarify what code is just for migrating from files.Louise Crow2014-09-25-2/+2
| |
* | fixup! Use translation tables for PublicBodyCategory and PublicBodyHeadingLouise Crow2014-09-25-2/+2
| |
* | fixup! Replace existing PublicBodyCategories functionality with db models ↵Louise Crow2014-09-24-69/+90
| | | | | | | | PublicBodyCategory and PublicBodyHeading
* | fixup! Remove dependence on default public bodies.Louise Crow2014-09-24-6/+6
| |
* | fixup! Validation of display order, default setting callbacks.Louise Crow2014-09-24-44/+49
| |
* | Validation of display order, default setting callbacks.Louise Crow2014-09-22-14/+74
| |
* | Add display order to public body categories and headingslizconlan2014-09-22-53/+112
| |
* | Reinstate automatic loading of categories on get if no categories definedlizconlan2014-09-22-0/+6
| |
* | Use translation tables for PublicBodyCategory and PublicBodyHeadinglizconlan2014-09-22-5/+33
| |
* | Replace existing PublicBodyCategories functionality with db models ↵lizconlan2014-09-22-0/+66
|/ | | | PublicBodyCategory and PublicBodyHeading
* Merge branch 'issues/1833-censor-rule-validation' into rails-3-developGareth Rees2014-09-15-6/+27
|\
| * Fix regressions in CensorRule specsGareth Rees2014-09-12-3/+12
| | | | | | | | Added extra validations to match Postgres constraints
| * Add correct validations to CensorRuleGareth Rees2014-09-12-3/+15
| |
* | Merge branch 'hotfix/0.19.0.1' into rails-3-developLouise Crow2014-09-04-0/+17
|\ \ | |/ |/|
| * Return a list of all cache directories for the requestLouise Crow2014-09-01-2/+7
| |
| * Move method to model to make it more testable, add spec.Louise Crow2014-09-01-0/+12
| |
* | Fix test failures in PublicBody overrideable CSV import specsSteven Day2014-08-22-2/+2
| |
* | Make csv import fields a class attribute that can be overridenSteven Day2014-08-22-0/+52
|/
* Merge branch 'issues/1415-bulk-update-public-bodies' into rails-3-developGareth Rees2014-06-25-0/+14
|\
| * Move PublicBody domain logic from controllerGareth Rees2014-06-06-0/+14
| | | | | | | | | | | | Moves the magic 'site_administration' tag logic to the PublicBody model. Easier to make the string passed to `PublicBody#has_tag?` configurable if we want to allow this to be set per install.
* | Handle unhelpful stemmingGareth Rees2014-06-25-0/+10
| | | | | | | | | | | | | | Stemming returns 'bore' as the word to highlight which can't be matched in the original phrase. Also removes duplicates from the results
* | Improve ActsAsXapian::Search#words_to_highlightGareth Rees2014-06-16-5/+35
| | | | | | | | | | | | - Ignore stopwords - Use Stemming - Wrap words with regex for use in a highlighter (optional)
* | Merge branch 'replace-xxx-todo' into rails-3-developGareth Rees2014-06-16-4/+4
|\ \
| * | Rename XXX comments with TODO:Gareth Rees2014-06-10-4/+4
| |/ | | | | | | Picks these up in `rake notes` and adds semantic meaning
* / Allow a message with more than one event to be destroyed.hotfix/0.18.0.2Louise Crow2014-06-06-0/+18
|/ | | | Fixes #1569
* Handle validation errors in PublicBody.import_csvGareth Rees2014-04-14-0/+13
| | | | | | | | | Specifically using save! so that anything other than an ActiveRecord::RecordInvalid doesn't get missed Note that ActiveModel::Errors#full_messages includes the attribute key in the message. This is by design, so we should consider whether we can improve the way that we use translated validation messages.
* Add missing validation to PublicBodyGareth Rees2014-04-14-0/+6
| | | | | There's a unique index on public_bodies url_name, so we should have a validation for that.
* Annotate modelsGareth Rees2014-04-09-19/+44
| | | | | Should have been run after related migrations. Could automate this to always run after migrations.
* Merge branch 'issues/1317-holding-pen-spam' into rails-3-developGareth Rees2014-04-07-0/+49
|\
| * Add SpamAddress modelGareth Rees2014-03-26-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The volume of spam in the holding pen in WDTK has increased. Over a few weeks in January 2014 the pattern was roughly: - 8 were sent "To" the same address, which was a nearly valid old request address - correct hash, but missing the second hyphen. - 1 was sent "To" an invalid request address (nearly correct hash) - 1 was sent "BCC" a valid request address - 1 was sent "BCC" request@whatdotheyknow.com If a spam was sent "To" an old valid request address then it would be rejected. It's not entirely safe to just reject mails to old requests with any hash, because sometimes authorities miss out a digit in the request number, though perhaps simply getting a failure bounce would cause them to check. In any case that wouldn't trivially catch the most frequent case above as it doesn't have an obvious request number. --- We looked at greylisting and configuring the MTA with an RBL. Greylisting was rejected as it would slow down the responsiveness of the application when people email in. This could be revisited if/when emails are parsed through a queue system depending on how we find the performance there. An RBL is already configured, but this ticket refers more to where the email is sent rather than who it came from. --- We elected to: - Create spam_address model - Add code to RequestMailer.receive to check the list of spam addresses and silently discard an incoming mail if it's addressed to one of them - Add page to admin interface for adding/removing spam addresses --- Thanks to Ganesh Sittampalam for the research and Louise Crow for the implementation strategy.
* | Merge branch 'feature/1310-better-track-translation' into rails-3-developLouise Crow2014-04-04-4/+5
|\ \ | | | | | | | | | | | | Conflicts: spec/factories.rb
| * | Make search description specs match actual casesLouise Crow2014-03-17-4/+5
| |/ | | | | | | | | | | In the largest Alaveteli instance, WDTK, only a fraction of tracks use filters and these specs represent those that have actually been used commonly.
* / Add specs for ContactValidatorGareth Rees2014-03-26-2/+47
|/
* Make test specific to versions of ruby with String.encodeLouise Crow2014-02-24-4/+6
| | | | The code being tested is specific in that way.
* Merge remote-tracking branch ↵Louise Crow2014-02-24-1/+7
|\ | | | | | | 'opennewzealand_github/feature/encode-utf8-messages' into rails-3-develop
| * Add test for _get_attachment_text_internal with invalid utf-8Rowan Crawford2014-02-23-1/+7
| |
* | Merge branch 'feature/batch-requests' into rails-3-developLouise Crow2014-01-29-3/+213
|\ \ | | | | | | | | | | | | | | | Conflicts: config/general.yml-example spec/factories.rb
| * | Send batch requests as a cron job.Louise Crow2013-12-04-0/+40
| | |
| * | Simplify return value, set sent_at in create_batch!Louise Crow2013-12-04-13/+34
| | |
| * | Use public bodies not requests in find_existingLouise Crow2013-12-04-6/+8
| | | | | | | | | | | | The requests may not have been created at this point.
| * | Split the creation of a batch and the associated requests.Louise Crow2013-12-04-10/+9
| | | | | | | | | | | | We're going to want to actually create and send the requests later.