X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5f4dcd34ff5943ff4de39bc8322013376a6de8b9..9c83235f72aece554426751e334c1f0b4ccaea64:/test/lib/i18n_test.rb diff --git a/test/lib/i18n_test.rb b/test/lib/i18n_test.rb index c18c2f346..3aa528ceb 100644 --- a/test/lib/i18n_test.rb +++ b/test/lib/i18n_test.rb @@ -13,7 +13,7 @@ class I18nTest < ActiveSupport::TestCase if default_value.is_a?(Hash) variables.push("count") - default_value.each do |_subkey, subvalue| + default_value.each_value do |subvalue| subvalue.scan(/%\{(\w+)\}/) do variables.push(Regexp.last_match(1)) end @@ -24,9 +24,7 @@ class I18nTest < ActiveSupport::TestCase end end - if key =~ /^(active(model|record)\.)?errors\./ - variables.push("attribute") - end + variables.push("attribute") if key =~ /^(active(model|record)\.)?errors\./ value = I18n.t(key, :locale => locale, :fallback => true) @@ -49,7 +47,7 @@ class I18nTest < ActiveSupport::TestCase end end - assert %w(ltr rtl).include?(I18n.t("html.dir", :locale => locale)), "html.dir must be ltr or rtl" + assert %w[ltr rtl].include?(I18n.t("html.dir", :locale => locale)), "html.dir must be ltr or rtl" end end