Rspec tests refactored