It's still working, so I just thought I'd throw in some of the other
stuff I had to figure out in this situation in case it helps anyone
else.
Model: Roles::Contact
Factory: contact_start (there is of course a vanilla factory, this is
a special case)
Associaton: contacts
By that last row I mean:
class User < ActiveRecord::Base
has_many :contacts, :class_name => 'Roles::Contact', :through
=> :user_contacts
So to get cucumber/pickle working you need to make the right choice
between factory name, model name, or association name. Really--going
through the code it looked like factory or model were supposed to be
interchangeable, but that wasn't my experience.
Here's a working approach:
Scenario: Referring to Roles_Contacts, aka Contacts, aka
contact_starts
#note plural before tables even if only one row
#note column name for Bob (label assignment) is FACTORY name
Given the following contact_addeds exist:
|contact_added |firstname | lastname |
| Bob | Bob | Test |
And the following users exist:
| user | username |
| foo | foo |
#but here the column name is the ASSOCIATION name and prefix label for
"Bob" is the MODEL name
And the following user_contacts exist:
| user | contact |
| user: "foo" | roles_contact: "Bob" |
#here it's MODEL name again, and note the plural
Then 1 roles_contacts should exist
When I log in as "foo"
#loading up 'last used' pickle ref for Bob because that's the only
approach I've gotten to work with route finding
Then a roles_contact "Bob" should exist with firstname: "Bob"
When I go to the roles_contact's edit page
#form_for + namespace = maximum verbosity. Yay?
Then the "roles_contact_phone" field should contain "1234567890"
...
and for that penultimate line, going to the edit page, this was needed
in paths.rb: