[rspec-users] undefined method `route_for

David Chelimsky dchelimsky at gmail.com
Mon Dec 7 07:10:33 EST 2009


On Mon, Dec 7, 2009 at 5:32 AM, Amit Kulkarni <lists at ruby-forum.com> wrote:

> Hi David,
> I have some query regarding running spec command.
> When i tried to run normal testcase by command "spec
> test_controller_spec.rb"
> then that particular test case runs but the routing testcase fails.
>
> Now if i run through the command "spec
> spec/controllers/test_controller_spec.rb" then all the spec runs
> including the routing spec.
>
> Can you tell me why is this happening?
>

rspec-rails creates different ExampleGroup subclasses for each type of spec
(model, view, controller, helper). It knows which type to create based on
the presence of "spec/controllers" (in this case) in the file's runtime
path, so you need to run specs from the project root in order for rspec to
make this determination.

HTH,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20091207/f4324198/attachment.html>


More information about the rspec-users mailing list