Refactor rspec test