Add Rails 4 Appraisal

Rails 4 includes strong parameters and removed att_accessible (protected
attributes). I removed the strong_parameters development dependency and
added it to all non-4.0 appraisals. I also added the
'protect_attributes' gem to the 4.0 appraisal because the test suite
examples make heavy use of attr_accessible.

All 3.x tests still pass. Many failures in 4.0 to attack
Fix render_with_layout_matcher on Rails 4.

Rails 4 moved the layouts ivar from `@layouts` to `@_layouts`.

This change introduces what I have (for now) called the 'RailsShim'. The
idea is that this single class will house the rail version workarounds,
which can then be reused through the code. This paid off here because
both the spec and the implementation need access to the layouts ivar.
Fix set_the_flash_matcher failures related to ivar

The flashes ivar has changed in Rails 4. I have added a shim to get the
proper ivar name. This fixed many failures in the spec for this matcher.
I believe the lone remaining failure is unrelated to the ivar name.
Use `get` instead of `match` in routes

match is not supported in Rails 4. This still leaves several failures in
the route_matcher, but these seem to be related to the underlying route
assertion relying on minitest methods. Need to do more research here...

https://github.com/rspec/rspec-rails/issues/635
https://github.com/rspec/rspec-rails/issues/679
Fix association_matcher in Rails 4

Rails 4 has deprecated the `:conditions` and `:order` options on
relationships in favor of passing a scope. Those properties are still
supported, but the implementation in Rails 4 shoves them into a scope.
Update the RailsShim class with a method that takes an association
reflection and finds the property to check for `:conditions` and `order`
regardless of rails version.
Fix have_db_column_matcher spec for primary key

You can't redefined the id column in rails 4 without also passing `id:
false` to the create table statement. Just using a different column name
for the spec is sufficient for our use here.
Fix allow_mass_assignment specs in Rails 4

This spec has a lot of active_model version checking in it. The version
checking helpers had to be updated to account for Rails 4.

I was able to remove the check for active_model 3.0 because 3.0 is now
the lowest supported rails version.
Fix route_matcher specs in Rails 4

The rails assertion that underlies the `route_matcher` matcher has
changed in Rails 4 to depend on the `message` method from MiniTest.
RSpec is smart enough to make that method available, but only for
controller and routing specs (and only in 2.13.1+).

I marked the `route_matcher` specs as controller specs and updated the
rspec-rails gem development dependency to 2.13.1 or later (but less than 3).
Bump gemfiles
Fix set_the_flash_matcher to work with Rails 4

The set_the_flash matcher will dup the flash hash for the controller on which it
operates. As #dup does a shallow copy we need to make sure to also copy the
instance variables within the flash hash when we do this. The Rails 4 version
of FlashHash has an extra @discard variable which we have neglected to copy in
this section of code, so this commit makes sure that we do that.
Fix appraisal gemfile lock files to use a relative path for the gem self reference
Bump version of rake in Gemfile.lock
Don't double install gems to speed up Cucumber tests a bit
Bump shoulda-matchers to 2.2.0 in the Rails 4 gemfile
Refactor AssociationMatcher to use the Rails shim in conjunction with new changes
Bump shoulda-context to 1.1.2 as it adds compatibility with Rails 4
Hook into AS::TestCase, not Test::Unit::TestCase

In Rails 4, ActiveSupport::TestCase no longer inherits from
Test::Unit::TestCase. In fact, everything uses ActiveSupport::TestCase
so there is no real reason for us to extend Test::Unit::TestCase.
Fix Cucumber tests to work with Rails 4
Use relations to define conditions and order on associations

In Rails 4, the following construct:

  has_many :children, conditions: { adopted: true }

changes to:

  has_many :children, lambda { where(adopted: true) }

As a result, the way we check the conditions attached to a has_many changes too:
instead of accessing `reflection.options`, we have to use `reflection.scope` --
this which refers to the lambda above, so we have to evaluate it and then grab
the `where` from the Relation that the lambda returns.
Fix validates_confirmation_of matcher so that it works under Rails 4

Rails 4 changed how validates_confirmation_of works so that the error message is
applied to the confirmation attribute, not the original attribute.