Skip to content

Commit b13e4ff

Browse files
committed
Use I18n.default_locale in faker config
The previous configuration had a hardcoded 'en' locale with a comment stating "Keep this as :en. Faker doesn't have :en-GB". However, testing confirms that Faker now works properly with :"en-GB". This change should allow for more accurate testing by using the application's specified locale.
1 parent ad899ae commit b13e4ff

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

spec/support/faker.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22

33
require 'faker'
44

5-
# Keep this as :en. Faker doesn't have :en-GB
6-
LOCALE = 'en'
7-
85
RSpec.configure do |config|
96
config.before(:each) do
10-
I18n.locale = LOCALE
11-
Faker::Config.locale = LOCALE
12-
I18n.default_locale = LOCALE
7+
I18n.locale = I18n.default_locale
8+
Faker::Config.locale = I18n.default_locale
139
end
1410

1511
config.after(:each) do

0 commit comments

Comments
 (0)