Hi all,
Just wanted to get some opinions on how to go about testing an extremely long form with 20+ required fields. It seems like my Cucumber scenario could be like 25 lines long if I tried to describe every field that need to be filled in (something like "And I fill in "Name:" with blah, And I fill in "Address" with foo, etc.).
If I simply say "When I provide all required information" as one of the Cucumber steps - it seems a little empty, but it keeps things clean. I then use Factory Girl to create a factory to represent a valid object, to test in cucumber steps and in model specs. Additionally I have model specs to make sure all required fields are included in the creation of the new object.
Question #1 - Does this suffice?
Question #2 - If I have 20+ required fields (this form collects a lot personal contact / history info), do you write a 20+ tests in your rspec model test to ensure each one of those fields is properly accounted for?
I know I cheated, asking 2 questions.. ;)