Move helper method to spec/support