On Mar 7, 2011, at 1:30 AM, DBA wrote:

> Hello guys,
> 
> I was just starting a rails 3.0.5 application with rspec-rails 2.5.0
> and ruby 1.9.2-p180 and when I went to describe my controller I ran
> into this undefined method 'get' error.
> 
> Here's the spec that is causing the problem (which lives in the folder
> spec/controllers)
> 
> require 'spec_helper'
> 
> describe ArticlesController, :type => :controller do
>  describe "GET index" do
>    get :index
>    response.should be_successful
>  end
> end

The `get` method is available in examples (the block passed to `it` or 
`specify`), but here it's being called in a group (the block passed to 
`describe` or context`). Try this instead:

describe ArticlesController, :type => :controller do
  describe "GET index" do
    it "returns a 200" do
      get :index
      response.should be_successful
    end
  end
end

HTH,
David
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to