Using Rails 3.0.3.
I have the following route in routes.rb:
match "user/create_new_password/:reset_password_key" =>"users#create_new_password", :via=>[:get, :post], :as=>:create_new_password
When using this route in the view, with a form, it works ok, however I'm not able to test it. I'm doing this in my functional test:
test "fail create password with invalid key" do
post :create_new_password, {:create_new_password=>{:password=>"1", :password_confirmation=>"1"}, :reset_password_key=>"user.reset_password_key"}
end
And I'm getting the error:
ActionController::RoutingError: No route matches {:create_new_password=>{:password=>"1", :password_confirmation=>"1"}, :reset_password_key=>"user.reset_password_key", :controller=>"users", :action=>"create_new_password"}
What's wrong here?