Bump .ruby-version to 2.1.2
Merge pull request #324 from alphagov/upgrade-ruby-to-2.1.2

Bump .ruby-version to 2.1.2
Only show the percentage of unresolved mappings when some exist

- Use an instance variable defined in the controller instead of data
  access in the views - pointed out by @jamiecobbett.
- Indent inside the `if` statement.
Refactor a tiny bit of data access in views to the controller

- Spotted by @jamiecobbett in https://github.com/alphagov/transition/pull/329.
Merge pull request #329 from alphagov/only_show_percentage_when_unresolved_mappings_exist

Only show the percentage of unresolved mappings when some exist
Merge pull request #330 from alphagov/refactor_site_tags_data_access_out_of_view

Refactor a tiny bit of data access in views to the controller
Create BulkAddBatch and use it for bulk add

This lets us add a second subclass for the ImportBatch which will have
different inputs and behaviour.
BulkAddBatch should create BulkAddBatchEntries
Basic ImportBatch#create_entries
Add ImportBatchRow

This will represent a row in the import CSV/TSV. It will act like a presenter,
encapsulating knowledge of how to translate the row into a ImportBatchEntry.
Add a basic ImportBatchesController
Add basic specs for ImportBatchesController

Also move the shared examples for a user without permission into
AuthenticationControllerHelpers.
ImportBatchesController creates a batch
Rename @import to @batch for the #new action

This makes the instance variables consistent with the #create action.
Add an import preview page

This displays counts of each type of mapping to be created, and a
table which currently contains all of the batch's entries (rather
than the first 20).

The table duplicates small parts of the _mappings_table partial, but
since that partial includes many behaviours we don't need here it is
simpler to have this duplication instead of trying to make the partial
usable in this context as well.

This also adds a feature for the happy path (at the moment it only goes
as far as the preview page).
Handle the old URL being an absolute URL
Canonicalize the old URL

ImportBatchRow needs the site to do this.
Basic semantic sorting of ImportBatchRows

Where there are multiple rows for an old URL, especially after canonicalization,
this will enable us to choose the "best" row from a CSV of mappings by sorting
them.
Refactor tests for line length
Earlier redirects trump later ones

To do this, we had to add line_numbers so that an ImportBatchRow can tell if it
came before another.