Permalink
Browse files

Add regression test for #378

  • Loading branch information...
1 parent bd0819c commit 6ab51c78be833eb011d5b4d3f5b2c54e74847512 @radar radar committed Jul 11, 2017
Showing with 5 additions and 1 deletion.
  1. +5 −1 test/backend/fallbacks_test.rb
@@ -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')
@@ -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

0 comments on commit 6ab51c7

Please sign in to comment.