"ArgumentError: Unknown key(s)" error when running controller test

Hello,

I'm running through a user authentication tutorial (http:// www.aidanf.net/rails_user_authentication_tutorial) and am getting some baffling errors when running functional tests.

Specifically, when running the test on my user controller, I get:

ArgumentError: Unknown key(s): password_confirmation, username, password, email

These keys are all defined in my model, either as database columns or using attr_accessor.

The test method that produces the error uses the following request: post :signup, :user => { :username => "newbob", :password => "newpassword", :password_confirmation => "wrong" , :email => "newbob@mcbob.com"}

whereas other test methods use the following and run fine: post :login, :user=> { :username => "bob", :password => "not_correct" }

So it seems the fields :password_confirmation and :email are somehow screwing things up.

Any ideas as to why I might be getting this error and/or how to fix it? Thanks so much for any help you can provide.

Almot 4 years after and the same thing is happening to me... did you remember how you solved it?

ok the problem was, i wasnt getting the param Id correctly in my controller