phonie
phonie copied to clipboard
Problems with 9 digits brazilian mobile phones
Some Brazilian mobile phones now have 9 digits.
Example:
This works
(Phonie::Phone.parse '31992211568', country_code: '55').area_code
31
But when area code is passed in the options instead of number:
(Phonie::Phone.parse '992211568', area_code: '31', country_code: '55').area_code
returns 99 and should return 31
test case that should pass:
def test_mobile_area_code_as_option_with_9
pn = Phonie::Phone.parse('987655678', { country_code: '55', area_code: '21' })
assert_equal pn.country_code, '55'
assert_equal pn.area_code, '21'
assert_equal pn.number, '987655678'
end