Created
April 8, 2015 18:58
-
-
Save jheg/cbdd4c6854c3288d3329 to your computer and use it in GitHub Desktop.
ruby test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test "product is not valid unless title is at least 10 characters long" do | |
product = Product.new( | |
title: "Book", | |
description: "yyy", | |
price: 1, | |
image_url: "fred.jpg" | |
) | |
assert product.invalid? | |
assert_equal ["Please ensure title is at least 10 characters long"], product.errors[:title] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment