Move testing function into helper.rb
Fix typo