Fix expectations to work on rails 3 and 4