0

I've got a form (using the simple_form gem) with an association:

= f.association :options, :label => 'Options:', :as => :check_boxes

That displays options as checkboxes. It looks fine in the browser when I click through. However, if I add a save_and_open_page to my spec, the Options are blank. There are no checkboxes. If I take the :as => check_boxes out so that it reverts to a multi-select, the multi-select is empty. I'm also using Twitter Bootstrap.

Unfortunately the bulk of my application that needs testing hinges on being able to select these options.

Here is my original question (which is somewhat irrelevant now that I've determined it's not rendering for Capybara) containing some of the markup: Checking checkboxes with Capybara

Community
  • 1
  • 1
Ryan Arneson
  • 1,323
  • 3
  • 14
  • 25
  • 1
    First question: Is the associated data in the test database? – DVG Jul 23 '12 at 19:11
  • That was a great question, no it was not. That table was populated via seed data and I never ran my `rake db:seed` command on the test database. You can add an answer and I'll accept. Thanks for pointing me in the right direction. – Ryan Arneson Jul 23 '12 at 20:24

1 Answers1

1

Make sure you get your seed data into the test database as well, or else build your test data on-the-fly using a test-data builder like Factory Girl!

DVG
  • 17,392
  • 7
  • 61
  • 88