alphagov/publisher — pull request #339 by fofr (2014-12-19 13:28:53+00:00)
Title: Allow editing of business support editions without javascript

https://www.agileplannerapp.com/boards/173808/cards/9005

Previously if you attempted to save edits to a business support format either:
* with javascript disabled
* with serialised form submitted via ajax

It would error with:
```
Mongoid::Errors::InvalidType in EditionsController#update
Field was defined as a(n) Array, but received a String with the value "england, london, north-west, west-midlands, south-east, north-east, south-west, yorkshire-and-the-humber, eastern, east-midlands".
```

* Split up business support tests into smaller ones
* Add test helpers for testing with and without javascript
* Coerce business support areas to an array when it's submitted as a string
* Simplify the javascript now that the non-js version works

Suggest reviewing with `?w=1`

Caveat: Now that the non-js version works it is easier to enter an ID for a region that is not necessarily a valid one. Some validation in content models that each item in the areas array corresponds to an actual area ID could be worthwhile.