Fix tests for Rails 4