Ruby Forum RSpec > Error testing rails controller

Posted by Jacob (Guest)
on 07.04.2008 16:41
(Received via mailing list)
I am trying to test my controllers with RSpec and from the examples I
have found it is as easy as this:

describe SessionsController do

  it "should render login template" do
    get 'new'
    response.should render_template(:login)
  end

end


However both get and post raise "wrong number of arguments (2 for 1)".
I am working with 1.1.3, I rolled back to 1.1.2 and still suffer the
same fate. Any thoughts onto what may be causing this issue?

Thanks
Posted by David Chelimsky (Guest)
on 07.04.2008 21:16
(Received via mailing list)
On Fri, Apr 4, 2008 at 12:46 PM, Jacob <jacob.basham@gmail.com> wrote:
> I am trying to test my controllers with RSpec and from the examples I
>  have found it is as easy as this:
>
>  describe SessionsController do
>
>   it "should render login template" do
>     get 'new'
>     response.should render_template(:login)
>   end

Try 'login'.
Posted by Jacob (Guest)
on 26.04.2008 20:40
(Received via mailing list)
It actually turned out to an invalid syntax in my controller,
completely unrelated.

Guess thats what I get for not checking my syntax before diving in.