Testing fields added dynamically by cocoon using rspec and capybara

后端 未结 3 1312
春和景丽
春和景丽 2021-01-05 17:36

I was wondering whether anybody tests fields that were dynamically added by cocoon?

It\'s a great little time saver but all of the fields that are added dynamically

3条回答
  •  长发绾君心
    2021-01-05 18:04

    A possible alternate that I just used is to dynamically update the label of each added form field (using the technique mentioned in https://github.com/nathanvda/cocoon/issues/374) and now my Cucumber/Capybara tests can easily insert text into the different multiple form fields distinguishing them via the different labels they have.

    Full details on what I did in this PR https://github.com/AgileVentures/WebsiteOne/pull/1818

提交回复
热议问题