updated to work with rails 4.1.2+ and rspec 3