replaced deprecated methods for rspec