refactored RSPEC tests