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

Salil Gaikwad
Tue, 14 Apr 2009 06:24:35 -0000

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'').should
include(''active'')
   end
end

it gives me following error

undefined local variable or method `params'' for
#<Spec::Rails::Example::RailsExa
mpleGroup::Subclass_1:0x5234150>

Regards

Salil