Method: Ndd::RSpec::Rails::Matchers::Model#have_a_translated_attribute
- Defined in:
- lib/ndd/rspec/rails/matchers/model.rb
#have_a_translated_attribute(attribute) ⇒ Ndd::RSpec::Rails::Matchers::Model::HaveATranslatedAttribute
Ensure that an attribute has an associated translation.
More precisely, ensure that
I18n.t(locale, "activerecord.attributes.{snake_case_class_name}.{snake_case_attribute_name}")
returns a value for the default locale (i.e. I18n.default_locale) or all the available locales (i.e. I18n.available_locales).
33 34 35 |
# File 'lib/ndd/rspec/rails/matchers/model.rb', line 33 def have_a_translated_attribute(attribute) # rubocop:disable Style/PredicateName HaveATranslatedAttribute.new(attribute) end |