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

Salil Gaikwad lists at ruby-forum.com
Tue Apr 14 02:24:35 EDT 2009


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
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list