Don't try to test a class against nil.
Apply pending migrations when possible.

Starting Rails 4.1 the test suite will automatically apply migrations which
will deprecate db:test:prepare. Let's jump on the bandwagon and also auto-
matically migrate.
Run specs on Ruby 2.1 on Travis-CI.
Run specs against Rails 4.1.
Silence Minitest nagging on Rails 3.2 and Ruby 2.
Don't load fixtures when database is unreachable.
Fix defined? check for JSON and Nokogiri.