Month in Spanish is capitalized when running test in Buildkite, but not in my development environment

Viewed 56

I have a test that started failing in Buildkite...

 Failure/Error: it { is_expected.to eq('Del 17 al 23 de febrero de 2019 (7 días)') }
 
       expected: "Del 17 al 23 de febrero de 2019 (7 días)"
            got: "Del 17 al 23 de Febrero de 2019 (7 días)"

Note that "febrero" is expected in all lowercase, but it's capitalized. The problematic string is generated with this code...

  let(:view) { ApplicationController.helpers }
  
  # ...

  view.l(payslip.end_date, format: '%e de %B de %Y', locale: 'es')

This same test is still working in my development environment. Previously it also worked in Buildkite, and no related code was changed when it started to fail. Moreover, if the Buildkite failed test is retried, sometimes it works.

Any idea on what could be happening?

2 Answers

Have you checked your locale settings? Seems like the locale setting is getting switched up between the tests. So depending on the order in which the tests are run the locale may or may not be the one you require on Buildkite. You locale setting on your local machine and for the test might be the same. That is why the test works correctly on the local machine but not on Buildkite

Related