Created
January 21, 2009 04:00
-
-
Save base10/49844 to your computer and use it in GitHub Desktop.
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
## Copyright 2009 Rex Luther Corporation. | |
## Licensed under the MIT License | |
## http://www.opensource.org/licenses/mit-license.php | |
it "should require a phone number have a valid format" do | |
@contact.phone = '(919) 555-1212' | |
@contact.should be_valid | |
@contact.phone = '919-555-1212' | |
@contact.should be_valid | |
@contact.phone = '919.555.1212' | |
@contact.should be_valid | |
@contact.phone = '919-555-121' | |
@contact.should_not be_valid | |
end | |
it "should allow phone numbers to use an extention " do | |
@contact.phone = '919-555-1212 x1234' | |
@contact.should be_valid | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment