Forum: Ruby on Rails Functional Test w/ Two Models in One Controller.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
F14c019cdc5e4cd23deb35b2f40608be?d=identicon&s=25 wilson (Guest)
on 2007-02-27 21:21
(Received via mailing list)

I'm trying to write a functional test, but I'm having problems pulling
two sets of models from my post request. I know how to grab one model
using "post :<action_name>, :<model> => { <params> }", but how do I do
it if i have another model within that post?

For example, I have a user_profile model and a user_settings model.
The view has them as profile and settings. I've tried both
"post :update, :profile => { junk_here}, :settings => { more_junk }"
as one whole post and as "post :update, :profile => { junk_here};
post :update, :settings => { more_junk }" as two different requests.
When i try to assert_valid assigns on my 2nd model, the model returns
as nil. Is there something I am missing? Thanks!
This topic is locked and can not be replied to.