Fix specs for Rails 3.1

Task 13323