rspec test refractoring