phonie icon indicating copy to clipboard operation
phonie copied to clipboard

Problems with 9 digits brazilian mobile phones

Open danicuki opened this issue 6 years ago • 1 comments

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

danicuki avatar May 23 '19 15:05 danicuki

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

danicuki avatar May 23 '19 15:05 danicuki