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

Salil Gaikwad lists at ruby-forum.com
Tue Apr 14 08:23:45 EDT 2009

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 params. If I recall correctly 
> you would have to do something like this:

Thanx fernando
i try the following

it "should be active if controller is same" do
    params = {:controller => 'royalty_statement'}
    tab_class('royalty_statement').should include('active')

but it doesn't work out. it gives me same error as previus.

Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list