Improvements to rspec tests