From 62f15d223e9025d9828ea8240db540fc7b0e64eb Mon Sep 17 00:00:00 2001 From: Laurent Dang Date: Tue, 26 May 2015 15:48:25 +0000 Subject: [PATCH] Fix excluded keyword in i18n tests --- spec/helpers/i18n_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/helpers/i18n_helper.rb b/spec/helpers/i18n_helper.rb index e88e127dc..997e410b6 100644 --- a/spec/helpers/i18n_helper.rb +++ b/spec/helpers/i18n_helper.rb @@ -2,6 +2,7 @@ def match_tags(path) File.open(path).read.scan(/\{\{\s*(?:'|")([a-z0-9._]+?)(?:'|")(?:\s*\|\s*t)/).flatten.map do |key| + next if include_excluded_keywords?(key) truncate_plural_key(key.split('.')) end.uniq end @@ -19,7 +20,7 @@ def truncate_plural_key(key) end def include_excluded_keywords?(key) - key.include?(*EXCLUDED_KEYWORDS) + EXCLUDED_KEYWORDS.any? { |w| key.include?(w) } end def locale_name_from_path(path)