title: How to test Ruby code with I18n translations in RSpec
body: <p>When testing Ruby code with I18n translations in RSpec, I get errors like this:</p>
  
  <pre><code>translation missing: en.lib.filter.equal_to
  </code></pre>
  
  <p>Here's a simplified example:</p>
  
  <pre><code>def word_for_operator
    I18n.t('lib.filter.equal_to')
  end
  </code></pre>
  
  <p>Spec:</p>
  
  <pre><code>it "returns the correct label" do
    expect(filter.word_for_operator).to eq("some value")
  end
  </code></pre>
  
  <p>Everything works fine in Rails.</p>
  
  <p>How can I use I18n in my specs?</p>