Upgrade to Rails 4.1.4

1 feature and 5 specs fail, plus a couple of warnings about minitest.
Fix minitest warnings by upgrading shoulda-matchers

We were getting these warnings when running any tests:

    Warning: you should require 'minitest/autorun' instead.
    Warning: or add 'gem "minitest"' before 'require "minitest/autorun"'

...and:

    MiniTest::Unit::TestCase is now Minitest::Test.

Upgrading shoulda-matchers removes these warnings - they were fixed in:

    https://github.com/thoughtbot/shoulda-matchers/commit/cd9594603eb9485deb63f3ce107e4ebf490efbf5
    https://github.com/thoughtbot/shoulda-matchers/pull/466
Fix test setup failures by separating use of factories

The 5 specs using this setup were failing with this error:

ActiveRecord::StatementInvalid:
  Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
    GROUP  BY hits.host_id,
              hits.path_hash' at line 4:           INSERT IGNORE INTO host_paths(host_id, path_hash, path)
    SELECT hits.host_id, hits.path_hash, path
    FROM   hits
    WHERE host_id  IN ()
    GROUP  BY hits.host_id,
              hits.path_hash

Separating the lets out and assigning the host to the site seems to
fix this. I assume that something related to transactions has changed
in the upgrade to Rails 4.1.0 but I can't see what's responsible for it.
Stop ActiveRecord generating nonsense SQL with .count

A bare count on a query which selects specific fields instead of * is turned into
invalid SQL by ActiveRecord. This is newly documented:

   https://github.com/rails/rails/commit/3023363fff502487740bd0b83a3069320551ec96

When we're selecting only some fields, .count generates COUNT(field1, field2)
which is invalid SQL. The recommended solution for this is to use .count(:all)
explicitly. In this case the rest of the partial uses .length, so I'm using
that instead here for consistency.

This fixes the last feature failure.
Prevent an unnecessary COUNT query by using .to_a
Remove a duplicate `hits.host_id` in custom select

This wasn't breaking anything.
Merge pull request #372 from alphagov/rails_4-1-4

Upgrade to Rails 4.1.4
Only show the ten most popular tags on the site dashboard
Merge pull request #373 from alphagov/site_dashboard_show_ten_most_popular_tags

Only show the ten most popular tags on the site dashboard
Update db/structure.sql to new format

As of Rails 4.0, db:structure:dump now uses mysqldump rather than a
custom format:

    https://github.com/rails/rails/commit/ccc6910cb034efc6b749e1ae82c748085a671fa9

It now includes a lot more detail - this commit doesn't include any
actual schema changes.
Merge pull request #375 from alphagov/update_structure_format

Update db/structure.sql to new format
Clarify a Cucumber step that creates tags
Merge pull request #374 from alphagov/clarify_tags_step

Clarify a Cucumber step that creates tags
Improve the explanation of unresolved behaviour on the site dashboard
Merge pull request #377 from alphagov/change_unresolved_text_site_dashboard

Improve the explanation of unresolved behaviour on the site dashboard
Add missing leading slash when canonicalising

This means that for a path-like input such as:
  first-level/second-level

we no longer trash it to make:
  /second-level

we instead make it into:
  /first-level/second-level

On the other hand it does mean that other things accidentally pasted into a
paths field will be turned into paths...
Merge pull request #367 from alphagov/add_missing_leading_slash_when_canonicalising

Add missing leading slash when canonicalising