ruby-on-railsrspecrails-i18nbuildkite

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


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?


Solution

  • The problem was that we use the ice_cube gem and it modifies the translation strings.

    We fixed it by using the fork linked from markedmondson's comment in the GitHub issue.