Permalink
Browse files

Do not take gems' i18n locales while testing locales paths

  • Loading branch information...
1 parent 8e5d910 commit 484d2aaed7987582612f59d1f0bc4aa07ffd8a1e @drogus drogus committed Dec 31, 2010
Showing with 8 additions and 2 deletions.
  1. +8 −2 railties/test/railties/shared_tests.rb
@@ -294,15 +294,21 @@ def test_i18n_files_have_lower_priority_than_application_ones
boot_rails
- assert_equal %W(
+ expected = %W(
#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/locale/en.yml
#{RAILS_FRAMEWORK_ROOT}/activemodel/lib/active_model/locale/en.yml
#{RAILS_FRAMEWORK_ROOT}/activerecord/lib/active_record/locale/en.yml
#{RAILS_FRAMEWORK_ROOT}/actionpack/lib/action_view/locale/en.yml
#{@plugin.path}/config/locales/en.yml
#{app_path}/config/locales/en.yml
#{app_path}/app/locales/en.yml
- ).map { |path| File.expand_path(path) }, I18n.load_path.map { |path| File.expand_path(path) }
+ ).map { |path| File.expand_path(path) }
+
+ actual = I18n.load_path.map { |path| File.expand_path(path) }.find_all do |p|
+ p =~ /^#{RAILS_FRAMEWORK_ROOT}/ || p =~ /^#{@plugin.path}/ || p =~ /^#{app_path}/
+ end
+
+ assert_equal expected, actual
assert_equal "2", I18n.t(:foo)
assert_equal "1", I18n.t(:bar)

0 comments on commit 484d2aa

Please sign in to comment.