I'm testing an application with questionnaires and pages in each
questionnaire. Suppose I have 3 yaml files (and corresponding tables):
questionnaires, pages and questionnaire_pages
In questionnaires.yml I have...
title: "Staff Application"
In pages.yml I have...
In questionnaire_pages.yml I want to do something like...
questionnaire_id: staff_application.id <-- substitutes 1 from
staff_application: id: in questionnaires.yml
page_id: intro_page.id <-- substitutes 1 from intro_page: id: in
Any way to do this? Otherwise, I'm sure you could see with a lot of
pages in the staff application it would be tough to get any information
out of questionnaire_pages with static integer ids.
Solutions I've come up with use irb escapes, either with global hashes
or Table.find methods. It's pretty ugly because it introduces load
order dependencies (ie staff_application_intro would have to be loaded
last). I would think this is something a lot of rails testers would
want. Any ideas?