ルートに関する他の問題を解決した後、今私は別の問題を抱えています。
私は自分のroutes.rbにこのルートを持っています:
match "user/create_new_password/:reset_password_key" =>"users#create_new_password", :via=>[:post, :get], :as=>:create_new_password
次のような機能テストでテストできます。
test "should create new password " do
post :create_new_password, {:user=>{:password=>"123456", :password_confirmation=>"123456"}, :reset_password_key=>user.reset_password_key}
end
私の見解では、私は次の形式を持っています:
=simple_form_for @user, :url=>create_new_password_path do |f|
=f.input :password, :label=>I18n.t("activerecord.attributes.user.email")
=f.input :password_confirmation, :label=>I18n.t("activerecord.attributes.user.password_confirmation")
=f.submit I18n.t "activerecord.actions.user.create_new_password"
フォームを送信すると、次のようになります。
No route matches "/user/create_new_password/OqQxYTgjYKxXgvbAsTsWtMnIpMOpsjCRzLGZmJZLSbYtjvcvdpO"
大きな文字列は、reset_password_keyです。
reset_password_keyに同じ値を使用して、機能テストでテストしました。
レーキルートに関連する出力は次のとおりです。
create_new_password POST|GET /user/create_new_password/:reset_password_key(.:format) {:controller=>"users", :action=>"create_new_password"}
何かが足りない...