This project is archived and is in readonly mode.

#1287 ✓resolved
Will Harris

Fix failing TranslationHelperTest

Reported by Will Harris | October 29th, 2008 @ 03:05 AM | in 2.x

A simplification to TranslationHelper's translate method's handling of options caused a test failure:

1) Error: test_delegates_to_i18n_setting_the_raise_option(TranslationHelperTest): IndexError: index 3969 out of string

./test/../lib/action_view/helpers/translation_helper.rb:7:in `[]='
./test/../lib/action_view/helpers/translation_helper.rb:7:in `translate'
./test/template/translation_helper_test.rb:14:in `test_delegates_to_i18n_setting_the_raise_option'
./test/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `__send__'
./test/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `run'

The test was sending the locale String as the second argument to translate, which was treating it as its options Hash, leading to an error when it tried to index the locale string using a Symbol.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Tags

Pages