Hi Mike, The wall you are facing is that the fork is nt prepared for functional controller testing so far. :-(
-- Volker On 14 Okt., 17:01, MikeBlyth <[email protected]> wrote: > Summary: I am trying to create a record in a functional test, in a > model with a belongs_to relationship to a parent. ActiveScaffold will > not "take" the <parent>_id supplied by the test; instead, the record > has a nil <parent>_id when saved. The result appears to be that a > dependent record cannot be created by itself in a functional test, > even though it has a valid parent. Is this expected behavior or a bug? > (I am using ActiveScaffold for Rails 3, the vhochstein branch.) > > Details: > I am trying to convert my functional test after adding ActiveScaffold > to my project. I have run into a certain difference and don't know if > it is intentional with ActiveScaffold, and if so, how to fix it. > > I have members and contacts models, where members have_many contacts. > This contact works for create and update tests in my project without > ActiveScaffold: > > one: > member_id: 1 > email_1: [email protected] > > The new record is constructed in update_record_from_params (in module > AttributeParams), which receives as parameters a list of columns and a > list of attributes. In the case I'm describing, "columns" includes > "member" but not "member_id", while "attributes" includes "member_id" > but not "member." As a result, member_id is not set in the record, > preventing it from being saved. > > If I set member_id manually after the record is constructed, it is > saved normally and the test succeeds. > > Am I just banging my head against a wall in trying to use the ordinary > Rails-style functional tests under ActiveScaffold at all? Are they > still important or useful, or should everything be switched to > something like Selenium? -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.
