refactoring rspec tests