[rspec-users] Cryptic error message when no controller_name

David Chelimsky dchelimsky at gmail.com
Sun Jan 28 22:15:16 EST 2007


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


More information about the rspec-users mailing list