Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
## 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