rspec tests refactored