fixed tests to be compatible with rails 4