Problem with assert_redirected_to on a RESTful route

I’m receiving an exception in my functional test where the message is
“NoMethodError: undefined method `first’ for :users:Symbol”

My routes.rb has this entry:

map.resources :users

My UsersController has a method as:

def create
@user =[:user])
flash[:notice] = “User was successfully created”
redirect_to user_url(@user)

My test methods consists of:
def please_work_for_once
post :create,
{ :user => { :username => “fred”, :password => “blah” } }
assert_equal “User was successfully created”, flash[:notice]
assert_redirected_to :controller => :users

It is failing on the assert_redirected_to line. I am using Edge Rails
revision 5884.

Can anyone please tell me what I’m doing wrong here? I’ve searched so
many web pages and discussion groups but no luck at all.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs