[rspec-users] Error in executing controller spec

David Chelimsky dchelimsky at gmail.com
Fri May 8 12:22:52 EDT 2009


On Fri, May 8, 2009 at 4:03 AM, Amit Kulkarni <lists at ruby-forum.com> wrote:
> Hello,
>
>     I am trying to execute controller spec but it gives me error which
> says
>
>     @controller is nil: make sure you set it in your test's setup
> method.
>
> I tried to search for the solution but till now no success :(
>
> Following is the description of the controller spec.
>
> describe ChannelCategoriesController do
>
>  context "Admin" do
>
>    before(:each) do
>      @cha_category = ChannelCategory.new
>    end
>
>      it "should delete categories" do
>        delete :destroy, :id => 1
>      end
>  end
> end
>
> Please advice :-)

Questions:

* ruby version
* rspec version
* rails version
* OS
* what's the path to the file
* how are you running the spec (rake, spec command, etc)
* pls provide a full backtrace
  * best in a gist or pastie
  * script/spec path/to/file --backtrace

Cheers,
David


More information about the rspec-users mailing list