Skip to content

Commit de26f7b

Browse files
committed
add test case for issue svenfuchs#51
1 parent 678f8ea commit de26f7b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/active_record_test.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,19 @@ def teardown
4848
test "expand_keys" do
4949
assert_equal %w(foo foo.bar foo.bar.baz), I18n.backend.send(:expand_keys, :'foo.bar.baz')
5050
end
51+
52+
test "available_locales returns uniq locales" do
53+
I18n::Backend::ActiveRecord::Translation.delete_all
54+
I18n.backend.store_translations(:en, :foo => { :bar => 'bar' })
55+
I18n.backend.store_translations(:en, :foo => { :baz => 'baz' })
56+
I18n.backend.store_translations(:de, :foo1 => 'foo')
57+
I18n.backend.store_translations(:de, :foo2 => 'foo')
58+
I18n.backend.store_translations(:uk, :foo3 => 'foo')
59+
60+
available_locales = I18n::Backend::ActiveRecord::Translation.available_locales
61+
assert_equal 3, available_locales.size
62+
assert_includes available_locales, :en
63+
assert_includes available_locales, :de
64+
assert_includes available_locales, :uk
65+
end
5166
end

0 commit comments

Comments
 (0)