[rspec-devel] [ rspec-Bugs-8240 ] Cryptic error message when no controller_name

noreply at rubyforge.org noreply at rubyforge.org
Sun Jan 28 22:26:28 EST 2007


Bugs item #8240, was opened at 2007-01-28 22:26
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8240&group_id=797

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: François Beausoleil (fbos)
Assigned to: Nobody (None)
Summary: Cryptic error message when no controller_name

Initial Comment:
In the following spec:

context "A project owner" do
 specify "can assign roles to other users" do
   # ...
 end
end

I get the following cryptic error message:

1)
NoMethodError in 'A project owner can assign roles to other users'
undefined method `session=' for #<Object:0xb741bed4>
/home/francois/src/smrty2/vendor/plugins/rspec_on_rails/lib/spec/rails/context/controller.rb:134:in
`setup_extra'
/home/francois/src/smrty2/vendor/plugins/rspec_on_rails/lib/spec/rails/functional_eval_context.rb:22:in
`setup'
/home/francois/src/smrty2/vendor/plugins/rspec_on_rails/lib/spec/rails/context/controller.rb:151:in
`setup'

Line 134 of controller.rb is:

@controller.session = session

We are probably only missing a check to ensure that @controller is
somehow defined.  Failing that should simply say "You forgot to define
controller_name in your controller spec".

This is on 0.7.5.1.

Thanks !
--
François Beausoleil

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8240&group_id=797


More information about the rspec-devel mailing list