Fix a test that doesn't work with Rails 4.2
Fix deprecation warnings