I&#39;m already successfully testing before_filters in application_controller courtesy of this blog post: <a href="http://www.movesonrails.com/articles/2008/01/23/spec-ing-your-application-controller">http://www.movesonrails.com/articles/2008/01/23/spec-ing-your-application-controller</a><br>
<br>However, i can;&#39;t work out how to test the sort of method that is added to application_controller so that all controllers can use it.&nbsp; It must be something simple that i&#39;m doing wrong/omitting, can anyone help?<br>
<br>eg if i have this empty method in application_controller<br><br>def&nbsp; andreplace(str)<br>end<br><br>and my spec looks like this:<br><br>describe ApplicationController do<br>&nbsp; describe &quot;andreplace(str)&quot; do<br>
&nbsp;&nbsp;&nbsp;&nbsp; it &quot;should format ands for ferret search&quot; do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; andreplace(&quot;foo and bar&quot;).should eql(&quot;+foo +bar&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp; end<br>end<br><br>Currently, the test breaks, saying:<br>NoMethodError in &#39;ApplicationController andreplace(str) should format ands for ferret search&#39;<br>
undefined method `andreplace&#39; for #&lt;Spec::Rails::Example::ControllerExampleGroup::Subclass_1::Subclass_1:0xb64f7160&gt;<br><br><br>What&#39;s going wrong here, anyone know?<br><br>