title: How to remove "DEPRECATION: stub! is deprecated. Use stub instead." message?
body: <p>The question is a bit odd formulated but what I want is an alternative for <code>stub!</code> in Rspec which doesn't produce a deprecation warning.</p>
  
  <p><strong>The scenario:</strong></p>
  
  <p>I use <code>stub!</code> to stub certain helper methods in my helper spec.</p>
  
  <p>For instance</p>
  
  <pre><code>stub!(:t_with_partner_lookup).and_return("test")
  </code></pre>
  
  <p>Rspec than suggests to use <code>stub</code> without the exclamation mark.</p>
  
  <p>So I write (as suggested):</p>
  
  <pre><code>stub(:t_with_partner_lookup).and_return("test")
  </code></pre>
  
  <p>However this produces an error:</p>
  
  <pre><code>Stub :t_with_partner_lookup received unexpected message :and_return with ("test")
  </code></pre>
  
  <p>In another question that I found, I had to use the <code>helper.</code> prefix. I did, but it didn't remove the deprecation warning instead it produced an error.</p>
  
  <pre><code>helper.stub(:t_with_partner_lookup).and_return("test")
  </code></pre>
  
  <p>Produces:</p>
  
  <pre><code>undefined method `t_with_partner_lookup' for #&lt;RSpec::Core::ExampleGroup::Nested_1::Nested_3:0x00000103256d50&gt;
  </code></pre>
  
  <p>I also tried this syntax but that produces the same error as noted above:</p>
  
  <pre><code>helper.stub(:t_with_partner_lookup){"test"}
  </code></pre>
  
  <p>What is the correct syntax for stubbing a helper method?</p>
  
  <p><strong>Gems I use</strong>:</p>
  
  <ul>
  <li>rails 3.2.17</li>
  <li>most recent version of rspec-rails</li>
  </ul>
  
  <p>Ruby version 2.1.0</p>