Re: [rspec-users] undefined local variable or method `params' for #

2009-06-08 Thread David Chelimsky
On Mon, Jun 8, 2009 at 12:21 AM, Salil Gaikwad wrote: > Hi All, > > Any Update on this topic. > > I still not found any solution for a following method. > >  it "should be active if controller is same" do >    tab_class('tab').should include('active') >  end Please read http://wiki.github.com/dche

Re: [rspec-users] undefined local variable or method `params' for #

2009-06-07 Thread Salil Gaikwad
Hi All, Any Update on this topic. I still not found any solution for a following method. it "should be active if controller is same" do tab_class('tab').should include('active') end Regards, Salil -- Posted via http://www.ruby-forum.com/. __

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Chris Flipse
helper.stub! the OP is testing a helper method. On Tue, Apr 14, 2009 at 9:04 AM, Fernando Perez wrote: > Try with that: > > controller.stub!(:params).and_return({:controller => > 'your_controller_name'}) > -- > Posted via http://www.ruby-forum.com/. >

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Salil Gaikwad
> Try with that: > > controller.stub!(:params).and_return({:controller => > 'your_controller_name'}) Nah it doesn't work out,gives same error. neways thanx for the info. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-user

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Fernando Perez
> it "should be active if controller is same" do > params = {:controller => 'royalty_statement'} > tab_class('royalty_statement').should include('active') > end > > but it doesn't work out. it gives me same error as previous. Nah it doesn't work that way, because remember that RSpec is

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Fernando Perez
Try with that: controller.stub!(:params).and_return({:controller => 'your_controller_name'}) -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Salil Gaikwad
Fernando Perez wrote: >> it gives me following error >> >> undefined local variable or method `params' for > > That's normal. Remember that params exists because there is an http > request issued. In your spec, you don't tell Rspec anything about any > request. So you could create a mock for pa

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Fernando Perez
> it gives me following error > > undefined local variable or method `params' for That's normal. Remember that params exists because there is an http request issued. In your spec, you don't tell Rspec anything about any request. So you could create a mock for params. If I recall correctly you

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-13 Thread aslak hellesoy
On Tue, Apr 14, 2009 at 8:24 AM, Salil Gaikwad wrote: > following is the method of the helper > > module ApplicationHelper > def tab_class(tab) >'class="active"' if tab == params[:controller] > end > end > > i write the spec method as follows > > describe ApplicationHelper do > it "should

[rspec-users] undefined local variable or method `params' for #

2009-04-13 Thread Salil Gaikwad
following is the method of the helper module ApplicationHelper def tab_class(tab) 'class="active"' if tab == params[:controller] end end i write the spec method as follows describe ApplicationHelper do it "should be active if controller is same" do tab_class('royalty_statement').s