File this under small problems that take more time than they should to solve, and I couldn’t find an answer with a web search.
Let’s use a simple example. If you have text like this in your translation file (e.g. en.yml):
users:
new:
header: "Let's go!"
And then show it in a view template (e.g. app/views/users/new.html.erb):
<h3><%= t('.header') %></h3>
And then try to match it in an Rspec test, you’ll get an error that it couldn’t be found:
expect(response.body).to include(I18n.t('users.new.header'))
Failure/Error: expected "[...]Let's go![...]" to include "Let's go!"