Francois Beausoleil
2007-Jan-29 03:12 UTC
[rspec-users] Cryptic error message when no controller_name
Hi ! 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 http://blog.teksol.info/ http://piston.rubyforge.org/
David Chelimsky
2007-Jan-29 03:15 UTC
[rspec-users] Cryptic error message when no controller_name
Please put this in the tracker: http://rubyforge.org/tracker/?group_id=797 Thanks, David On 1/28/07, Francois Beausoleil <francois.beausoleil at gmail.com> wrote:> Hi ! > > 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 > http://blog.teksol.info/ > http://piston.rubyforge.org/ > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
Francois Beausoleil
2007-Jan-29 03:27 UTC
[rspec-users] Cryptic error message when no controller_name
Hi ! 2007/1/28, David Chelimsky <dchelimsky at gmail.com>:> Please put this in the tracker: > http://rubyforge.org/tracker/?group_id=797Yes, of course. I''m so sorry not to have done that right at first. Here''s the link: http://rubyforge.org/tracker/index.php?func=detail&aid=8240&group_id=797&atid=3149 Bye ! -- Fran?ois Beausoleil http://blog.teksol.info/ http://piston.rubyforge.org/