Skip to content

Instantly share code, notes, and snippets.

@x37v
Created September 17, 2010 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x37v/584522 to your computer and use it in GitHub Desktop.
Save x37v/584522 to your computer and use it in GitHub Desktop.
test "paypal validation helper" do
address = "1 Main St"
zipcode = 95131
emails = %w{
foo_1284577745_per@gmail.com
FOO_1284577745_per@gmail.com
foo_1284577745_per@GMAIL.com
FoO_1284577745_per@GmAiL.Com
FoO_1284577745_per@GmAiL.CoM
}
emails.each do |email|
res = UserValidationsHelper::paypal_address_verify(email, address, zipcode)
assert res != :fail, "Failed to validate email against paypal"
assert res != :timeout, "Timeout while validating email against paypal"
assert res["CONFIRMATIONCODE"].downcase == "confirmed", "Address should be confirmed"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment