Added tests for ActiveRecord 4.0 and 4.1 and fixed rspec deprecations