refactoried the rspec test