Refactor specs using rspec mocks and spies