Hi,
I'm running a Rails 3.0.0.rc, Shoulda 2.11.2 application and I'm
facing the same problem...
When I a try
should redirect_to(root_path)
I get
usr/local/lib/ruby/gems/1.8/gems/shoulda-2.11.2/lib/shoulda/context.rb:
429:in `send': undefined method `root_path' for
Admin::RoomsControllerTest:Class (NoMethodError)
and if I wrap the matcher in a lambda (should
{ redirect_to(root_path) }) I get a
./test/functional/admin/rooms_controller_test.rb:67:in `should': wrong
number of arguments (0 for 1) (ArgumentError)
Any idea?
Thanks,
Yannis
On Aug 4, 6:54 pm, Dan Croak <
dcr...@thoughtbot.com> wrote:
> Barnabas,
>
> You need to wrap the matcher in a lambda:
>
> should { redirect_to(root_path) }
>
> That should do it.
>
> Dan
>
>
>
> On Fri, Jul 30, 2010 at 2:43 PM, Barnabas <
k...@goa.hu> wrote:
> > Hi there everyone,
>
> > I am new on this list and I'm a new shoulda user too.
>
> > I am writing my first tests and found out that I can't use root_path
> > for some reason in my tests - but I've seen this in a few examples...
>
> > an example test:
>
> > context "test basic redirect" do
> > setup do
> > get :show
> > end
> > should redirect_to(root_path)
> > end
>
> > $ ruby test/functional/application_controller_test.rb -v
> > /Library/Ruby/Gems/1.8/gems/shoulda-2.11.1/lib/shoulda/context.rb:
> > 429:in `send': undefined method `root_path' for
> > ApplicationControllerTest:Class (NoMethodError)
>
> > I tried a fewroutes, but none of them were working.