Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed mobile prefixes for en-GB locale #1929

Merged
merged 1 commit into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/locales/en-GB.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ en-GB:
phone_number:
formats: ['01#### #####', '01### ######', '01#1 ### ####', '011# ### ####', '02# #### ####', '03## ### ####', '055 #### ####', '056 #### ####', '0800 ### ####', '08## ### ####', '09## ### ####', '016977 ####', '01### #####', '0500 ######', '0800 ######']
cell_phone:
formats: ['074## ######', '075## ######', '076## ######', '077## ######', '078## ######', '079## ######']
formats: ['071## ######', '073## ######', '074## ######', '075## ######', '07624 ######', '077## ######', '078## ######', '079## ######']
7 changes: 7 additions & 0 deletions test/test_en_gb_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ def test_en_gb_cell_phone_starts_with_zero
assert_equal '0', mobile[0]
end

def test_en_gb_cell_phone_is_valid
mobile = Faker::PhoneNumber.cell_phone.gsub(/\D/, '')
assert_match(/07[13456789]\d{8}/, mobile)
# Pager numbers begin with 070 and 076xx. 07624 is used for mobiles on the Isle of Man
refute_equal(/076(?!24)\d{8}|070\d{8}/, mobile)
end

def test_en_gb_postcode_has_outcode_and_incode
postcode = Faker::Address.postcode
assert_equal 2, postcode.split(' ').length
Expand Down