title: How to stub Rails secret in RSpec?
body: <p>Now that Rails comes with credential/secret file I can't seem to stub/override a secret with RSpec.</p>
  
  <pre><code># credentials.yml.enc
  my_token: 111
  </code></pre>
  
  <p>With environment variable we used to do</p>
  
  <pre><code>allow(ENV).to receive(:[]).with('my_token').and_return('')
  </code></pre>
  
  <p>So I was expecting to be able to apply the same logic like</p>
  
  <pre><code>allow(Rails.application.credentials).to receive(:my_token).and_return('')
  </code></pre>
  
  <p>But it does not override Rails secret. Any idea? Thanks</p>