lib/tram/policy/rspec.rb in tram-policy-2.1.0 vs lib/tram/policy/rspec.rb in tram-policy-2.2.0
- old
+ new
@@ -4,10 +4,10 @@
def locales
@locales ||= I18n.available_locales
end
def check(policy, tags)
- @errors ||= policy.errors.filter(tags).map do |error|
+ @errors ||= policy.errors.filter(**tags).map do |error|
{ item: error.item }.tap do |obj|
locales.each { |l| obj[l] = I18n.with_locale(l) { error.message } }
end
end
end