Add updated_at field to Json output.

This will be needed by the search indexing process to be able to
do some kind of version compairson - to be able to ensire that an older
version doesn't overwrite a newer versions (e.g while doing bulk index
rebuilds)
Update docs to reflect updated_at field
Extract validation of absolute path...

... so we can re-use it elsewhere
Add rendering_app to ContentItem
Register ContentItem routes

A set of routes gets registered for a ContentItem when it is saved to
the store.
Correct typo in factory
Prevent real web requests during tests

Relies on GdsApi::TestHelpers::Router and webmock to stub out route
registration calls
Store registered routes after registration

We store the routes that were registered in the same format as they
would have been set.
Ignore base_path in request data

We use the base_path as defined in the routing params so we can ignore
completely base_path as it appears in the request body. We want to avoid
mass-assigning base_path as, although the alias of _id to base_path
prevents it being saved in the database, it doesn't prevent the virtual
base_path attribute from being set, which screws up the registerable
route calculations
Tighten up rules around route validation

Specifically we want to reject routes that are a string-prefix of the
base_path, but not an actual folder below the base_path.
Globally stub all route registration by default

We can still verify the expected router calls were made (or not made)
where required using assert_requested/assert_not_requested
Tighten up route registration coverage

Instead of mocking internal code, we verify the appropriate route
registration requests were made using webmock helpers. This brings us
closer to an end-to-end test for creating and updating content items.
Do not implicitly create route for base_path

This was too much magic. Better to require that all routes are
explicitly set when creating/updating content.
Merge pull request #19 from alphagov/route-registration

Add ContentItem route registration
Merge pull request #18 from alphagov/add_updated_at_to_output

Add updated_at field to Json output.
Only allow full replacements in PUT requests.

Previously, a PUT request would allow updates with some fields missing,
leaving them with their previously-stored values. This change makes the
success or failure of a PUT request, and the resulting state of the
stored data for the content item concerned, purely dependent on the
content of the request.
Remove the `created_at` timestamp.

Since we now overwrite items from scratch, this is always going to be
the same as `updated_at`.
Add unit tests around upsert operations.

Because `upsert` and `save` have separate callback logic, we need tests
for both.
Merge pull request #21 from alphagov/no-partial-updates

Only allow full replacements in PUT requests.
Simplify persistence and registraion of routes.

Given what's being persisted on the model is in the same format as the
data passed in, we can just store that like any other field, and then
have the route registration act on that field.