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

Fernando Perez
Tue, 14 Apr 2009 12:01:26 -0000

> 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:

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