I have a Story resource nested in a user resource. How can I fix this generated functional test?
test "should create story" do assert_difference('Story.count') do post :create, story: @story.attributes end assert_redirected_to story_path(assigns(:story)) end
DGM solution still has story_url problem
You need to specify the user ID in which it is embedded:
post :create, story: @story.attributes, user_id: @user.id
The path may be something like
user_story_path(@user.id, assigns(:story))
Source: https://habr.com/ru/post/1379786/More articles:SQL add datetime add hour add minute - sql"Automatic double single quote" in Dreamweaver cs5.5 - dreamweaver(Apache Mod_Rewrite) Please help condensate my request - .htaccessCan I define a MyType that can only contain these values? - delphiMultilinear JTable cells with automatic height - very large first row - javaHow can I provide an editable default value when prompted for user input? - terminalHow to test different classes using one interface? - c #Why are my objects displayed as an “object object”? - javascriptHow to focus on a specific part of a web page using javascript? - javascriptSet the color of the Quantmod chartSeries line from green to another color - rAll Articles