Skip to content

Instantly share code, notes, and snippets.

@JulioGMedina
Created February 19, 2012 01:27
Show Gist options
  • Select an option

  • Save JulioGMedina/1861537 to your computer and use it in GitHub Desktop.

Select an option

Save JulioGMedina/1861537 to your computer and use it in GitHub Desktop.
test "image url" do
ok = %w{ blah.gif blah.jpg blah.png BLAH.JPG
BLAH.Jpg abb/xyz/blah.gif}
bad = %w{ blah.doc blah.gif/more blah.gif.more
blah.gif.more }
ok.each do |name|
assert new_product(name).valid?,
"#{name} shouldn't be invalid'"
end
bad.each do |name|
assert new_product(name).invalid?,
"#{name} shouldn't be valid' "
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment