Using I18n in capybara feature specs
Seems OK to me.

However, it might be nice to add a "macro" to let you skip the I18n. and just use t like you do in views.

And you can add some extra checks while you're at it, since you'll i18n want it to make noise when testing.

For instance, you could add a file like spec/support/macros/i18n_macros.rb with the following:

module I18nMacros
  def t(*args)
    I18n.translate!(*args)
  end
end


Using translate! will cause i18n to raise an exception if the translation you're looking for doesn't exist.

Then include it in spec_helper.rb

config.include I18nMacros


or alternatively include it for type: :feature specs only.

And if you haven't already (it's default for newer versions of Rails), set i18n to raise exceptions in your views (the above will only raise on the stuff in your tests). Put something like this in config/environments/test.rb

# Raises error for missing translations
config.action_view.raise_on_missing_translations = true