Refactor rspec file