Forum: Ruby on Rails Problem with assert_redirected_to on a RESTful route

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
53d4002427665db72120f3fa0714ea52?d=identicon&s=25 Ruby.Me.Silly (Guest)
on 2007-01-19 16:29
(Received via mailing list)
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 topic is locked and can not be replied to.