refracting rspec code for digit