[rspec-users] Stub a controllers helper_method in a view template helper spec

Kai Schlamp kai.schlamp at googlemail.com
Mon Mar 21 14:12:49 EDT 2011


> > undefined local variable or method `helper' for #<#<Class:0xb66566a0>:
> > 0xb665532c>
>
> What's the full backtrace?

  1) ApplicationHelper order link should create html link
     Failure/Error: order_link(:name)
     NoMethodError:
       undefined method `fetch_param' for #<#<Class:0xb64ba0d0>:
0xb64a1ef4>
     # ./app/helpers/application_helper.rb:43:in `order_link'
     # ./spec/helpers/application_helper_spec.rb:22
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example.rb:49:in `instance_eval'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example.rb:49:in `run'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example.rb:106:in `with_around_hooks'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example.rb:46:in `run'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example.rb:99:in `with_pending_capture'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example.rb:98:in `catch'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example.rb:98:in `with_pending_capture'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example.rb:45:in `run'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example_group.rb:262:in `run_examples'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example_group.rb:258:in `map'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example_group.rb:258:in `run_examples'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example_group.rb:232:in `run'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example_group.rb:233:in `run'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example_group.rb:233:in `map'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/example_group.rb:233:in `run'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/command_line.rb:27:in `run'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/command_line.rb:27:in `map'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/command_line.rb:27:in `run'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/reporter.rb:12:in `report'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/command_line.rb:24:in `run'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/runner.rb:55:in `run_in_process'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/runner.rb:46:in `run'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/gems/rspec-core-2.5.1/lib/
rspec/core/runner.rb:10:in `autorun'
     # /home/kai/.rvm/gems/ruby-1.8.7-p330/bin/rspec:19


More information about the rspec-users mailing list