Created
May 23, 2011 21:03
-
-
Save jnstq/987601 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
it "normalize swedish cell phone number" do | |
user = Factory.build(:user, :cell_phone => "0707-293274") | |
described_class.new(:recipient => user).recipient_normalized_cell_phone.should == "0046707293274" | |
user = Factory.build(:user, :cell_phone => "+46707-293274") | |
described_class.new(:recipient => user).recipient_normalized_cell_phone.should == "0046707293274" | |
user = Factory.build(:user, :cell_phone => "0046707293274") | |
described_class.new(:recipient => user).recipient_normalized_cell_phone.should == "0046707293274" | |
end | |
it "normalize finnish cell phone number" do | |
user = Factory.build(:user, :cell_phone => "04123456789") | |
described_class.new(:recipient => user).recipient_normalized_cell_phone.should == "003584123456789" | |
user = Factory.build(:user, :cell_phone => "05123456789") | |
described_class.new(:recipient => user).recipient_normalized_cell_phone.should == "003585123456789" | |
user = Factory.build(:user, :cell_phone => "+3585123456789") | |
described_class.new(:recipient => user).recipient_normalized_cell_phone.should == "003585123456789" | |
user = Factory.build(:user, :cell_phone => "003585123456789") | |
described_class.new(:recipient => user).recipient_normalized_cell_phone.should == "003585123456789" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment