diff --git a/test/backend/fallbacks_test.rb b/test/backend/fallbacks_test.rb index 2b17da94..6ea09207 100644 --- a/test/backend/fallbacks_test.rb +++ b/test/backend/fallbacks_test.rb @@ -10,6 +10,7 @@ def setup store_translations(:en, :foo => 'Foo in :en', :bar => 'Bar in :en', :buz => 'Buz in :en') store_translations(:de, :bar => 'Bar in :de', :baz => 'Baz in :de') store_translations(:'de-DE', :baz => 'Baz in :de-DE') + store_translations(:'pt-BR', :baz => 'Baz in :pt-BR') end test "still returns an existing translation as usual" do @@ -74,6 +75,15 @@ def setup test "should ensure that default is not splitted on new line char" do assert_equal "Default \n Bar", I18n.t(:missing_bar, :default => "Default \n Bar") end + + test "should not raise error when enforce_available_locales is true, :'pt' is missing and default is a Symbol" do + I18n.enforce_available_locales = true + begin + assert_equal 'Foo', I18n.t(:'model.attrs.foo', :locale => :'pt-BR', :default => [:'attrs.foo', "Foo"]) + ensure + I18n.enforce_available_locales = false + end + end end class I18nBackendFallbacksLocalizeTest < Test::Unit::TestCase