When testing I get this code I get the following error:
test “should update proveedor” do
put :update, :id => proveedores(:iberdrola).to_param, :proveedor =>
{:fax => ‘943456578’}
assert_redirected_to proveedor_path(assigns(:proveedor))
end
- Error:
test_should_update_proveedor(ProveedoresControllerTest):
ActionController::RoutingError: proveedor_url failed to generate from
{:action=>“show”, :id=>nil, :controller=>“proveedo
res”}, expected: {:action=>“show”, :controller=>“proveedores”}, diff:
{:id=>nil}
(eval):16:inproveedor_path' /test/functional/proveedores_controller_test.rb:37:in
test_should_update_proveedor’
I have searched the web and I know that the problem is that
assigns(:proveedor) are not putting the param id that is necessary to
generate the correct URL, but why? Any idea?