Method: Ndd::RSpec::Rails::Matchers::Controller#have_a_translated_flash
- Defined in:
- lib/ndd/rspec/rails/matchers/controller.rb
#have_a_translated_flash(message) ⇒ Ndd::RSpec::Rails::Matchers::Controller::HaveATranslatedFlash
Ensure that a controller has a translated flash message for the given key.
More precisely, ensure that (with all parameters being snake case) one of
I18n.t(locale, "actioncontroller.#{controller_key}.#{action_key}.flash.#{message_key}")
I18n.t(locale, "actioncontroller.#{controller_key}.flash.#{message_key}")
I18n.t(locale, "actioncontroller.#{action_key}.flash.#{message_key}")
I18n.t(locale, "actioncontroller.flash.#{message_key}")
returns a value for the default locale (i.e. I18n.default_locale) or all the available locales (i.e. I18n.available_locales).
41 42 43 |
# File 'lib/ndd/rspec/rails/matchers/controller.rb', line 41 def have_a_translated_flash() # rubocop:disable Style/PredicateName HaveATranslatedFlash.new() end |