Created
March 22, 2012 18:02
-
-
Save maceto/2161158 to your computer and use it in GitHub Desktop.
minitest validates presence true
This file contains hidden or 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
require "minitest_helper" | |
describe Street do | |
it "must have a code" do | |
# No code | |
street = Street.new | |
# Invalid | |
street.valid?.must_equal false | |
# Code assignation (random 1000/10000) | |
street.code = rand(9000) + 1000 | |
# Valid | |
street.valid?.must_equal true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment