Skip to content

Commit

Permalink
Add regression test for #378
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Jul 11, 2017
1 parent bd0819c commit 6ab51c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/backend/fallbacks_test.rb
Expand Up @@ -8,7 +8,7 @@ class Backend < I18n::Backend::Simple
def setup
super
I18n.backend = Backend.new
store_translations(:en, :foo => 'Foo in :en', :bar => 'Bar in :en', :buz => 'Buz in :en')
store_translations(:en, :foo => 'Foo in :en', :bar => 'Bar in :en', :buz => 'Buz in :en', :interpolate => 'Interpolate %{value}')
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')
Expand All @@ -20,6 +20,10 @@ def setup
assert_equal 'Baz in :de-DE', I18n.t(:baz, :locale => :'de-DE')
end

test "returns interpolated value if no key provided" do
assert_equal 'Interpolate %{value}', I18n.t(:interpolate)
end

test "returns the :en translation for a missing :de translation" do
assert_equal 'Foo in :en', I18n.t(:foo, :locale => :de)
end
Expand Down

0 comments on commit 6ab51c7

Please sign in to comment.