File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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
5166end
You can’t perform that action at this time.
0 commit comments