Refactoring rspec tests