Developed by the the Alliance in collaboration with University of Alberta, DMP Assistant a data management planning tool, forking the DMP Roadmap codebase
MIT License
6
stars
1
forks
source link
Set Locales Within Test Environment to Match Locales Used Within App #931
Please complete the following fields as applicable:
What version of the DMPRoadmap code are you running? (e.g. v2.2.0)4.1.1+portage-4.2.2
Expected behaviour:
The test suite includes several translation-focused tests (e.g. testing what is rendered for translation.#{LOCALE}.yml files and testing output of _(). We would like to be able to ensure that these tests are working for locales that exist within our app.
Actual behaviour:
Tests mostly appear to be configured for either :en (the default I18n locale) or :'en-GB'.
In order to test a file like config/locales/translation.en-CA.yml, overriding is required within a test.
Overriding example:
before(:each) do
@default_locale = I18n.default_locale
I18n.default_locale = :'en-CA'
end
after(:each) do
I18n.default_locale = @default_locale
end
Please complete the following fields as applicable:
What version of the DMPRoadmap code are you running? (e.g. v2.2.0)
4.1.1+portage-4.2.2
Expected behaviour:
translation.#{LOCALE}.yml
files and testing output of_()
. We would like to be able to ensure that these tests are working for locales that exist within our app.Actual behaviour:
:en
(the defaultI18n
locale) or:'en-GB'
.config/locales/translation.en-CA.yml
, overriding is required within a test.Overriding example:
Relevant Files
spec/features/locales_spec.rb
spec/support/faker.rb
spec/support/locales.rb