[rspec-users] Cryptic error message when no controller_name

Francois Beausoleil francois.beausoleil at gmail.com
Sun Jan 28 22:12:30 EST 2007

Hi !

In the following spec:

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

I get the following cryptic error message:

NoMethodError in 'A project owner can assign roles to other users'
undefined method `session=' for #<Object:0xb741bed4>

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

Thanks !
François Beausoleil

More information about the rspec-users mailing list