且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

功能测试和嵌套资源

更新时间:2023-11-27 13:54:52

您需要提供它所嵌套的用户 ID:

You need to provide the user id it is nested in:

post :create, story: @story.attributes, user_id: @user.id

路径可能类似于,

user_story_path(@user.id, assigns(:story))