Refactored rspec test