[rspec-users] Testing misc methods in ApplicationController
toastkid.williams at gmail.com
Fri Feb 22 08:26:40 EST 2008
I'm already successfully testing before_filters in application_controller
courtesy of this blog post:
However, i can;'t work out how to test the sort of method that is added to
application_controller so that all controllers can use it. It must be
something simple that i'm doing wrong/omitting, can anyone help?
eg if i have this empty method in application_controller
and my spec looks like this:
describe ApplicationController do
describe "andreplace(str)" do
it "should format ands for ferret search" do
andreplace("foo and bar").should eql("+foo +bar")
Currently, the test breaks, saying:
NoMethodError in 'ApplicationController andreplace(str) should format ands
for ferret search'
undefined method `andreplace' for
What's going wrong here, anyone know?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users