Skip to content

Update spec/support/faker.rb Assignments to Use I18n.default_locale - #3511

Merged
aaronskiba merged 1 commit into
upstream/aaron/add-email-confirmationfrom
aaron/issues/update-faker-locale
Apr 24, 2025
Merged

Update spec/support/faker.rb Assignments to Use I18n.default_locale#3511
aaronskiba merged 1 commit into
upstream/aaron/add-email-confirmationfrom
aaron/issues/update-faker-locale

Conversation

@aaronskiba

@aaronskiba aaronskiba commented Apr 15, 2025

Copy link
Copy Markdown
Contributor

Changes proposed in this PR:

  • Update spec/support/faker.rb to replace 'en' with I18n.default_locale for assigning locales. This change should allow for more accurate testing by using the application's specified locale.
    • Prior to this PR, there was a commit in the aforementioned file that read "Keep this as :en. Faker doesn't have :en-GB". However, I18n.default_locale evaluates to :"en-GB" for this codebase, and all of the tests appear to be passing. Additionally, the branch that this PR is pointed at (upstream/aaron/add-email-confirmation), uses I18n.t(...) for several tests, and this change is required for those tests to pass.
aaronskiba added a commit that referenced this pull request Apr 15, 2025
- Removed the 'A user attempts to sign in via the "Sign in with institutional or social ID"...' test which is specific to DMP Assistant functionality.
- Removed hardcoding of I18n.default_locale = :'en-CA'
  - However, the current test config is preventing us from using the `I18n.default_locale` value that is specific to the app. This in turn is causing issues with I18n.t() using the desired locale.
    - #3511 seeks to remedy the above issues.
@aaronskiba
aaronskiba changed the base branch from development to upstream/aaron/add-email-confirmation April 15, 2025 22:38
@aaronskiba
aaronskiba force-pushed the upstream/aaron/add-email-confirmation branch 2 times, most recently from cf70685 to bcc8d1f Compare April 22, 2025 19:33
@aaronskiba
aaronskiba force-pushed the aaron/issues/update-faker-locale branch 2 times, most recently from 035422b to 6bc154e Compare April 22, 2025 23:12
@aaronskiba
aaronskiba force-pushed the upstream/aaron/add-email-confirmation branch 3 times, most recently from f1bef17 to 9209fce Compare April 23, 2025 02:31
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.
@aaronskiba
aaronskiba force-pushed the aaron/issues/update-faker-locale branch from 6bc154e to a69e9dd Compare April 23, 2025 02:42
@aaronskiba
aaronskiba marked this pull request as ready for review April 23, 2025 18:52
@aaronskiba aaronskiba changed the title Use I18n.default_locale in faker config Apr 23, 2025
@aaronskiba
aaronskiba merged commit 85d724e into upstream/aaron/add-email-confirmation Apr 24, 2025
@aaronskiba
aaronskiba deleted the aaron/issues/update-faker-locale branch April 24, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant