New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple choice selection box param values returned as array of arrays #649
Comments
Are you on the latest version of everything? Rack, RackTest, Capybara, Cucumber, etc. I'm pretty sure this should be fixed. |
Perhaps not. Here is what I am using. Do any seem out of date. rails 3.0.7 capybara (1.1.2) rack (1.2.5) |
I just updated to cucumber 1.0.6, but no luck. |
The latest release of Rack is at 1.4.1, RackTest at 0.6.1. You're out of date on both fronts. Please upgrade these and see if that fixes anything. |
Unfortunately, rails 3.0.11, which is what our project is still using, requires rack ~> 1.2.1, so I can't yet upgrade to rack 1.4.1 |
You should really upgrade to Rails 3.1. If you switch off the asset pipeline, there are hardly any incompatibilities. Unfortunately we can't fix this bug in Capybara, so you'll have to either upgrade or switch to a different driver. |
I recently began getting an error when running Cucumber specs where a multipart form returned a selection_collection field with multiple => true.
In my case, the selection_collection field relates an object to a habtm relationship.
where f is a form for a Cause object.
When the spec hits the controller statement that saves the Cause object, I get the following error:
Couldn't find Category with ID=0 (ActiveRecord::RecordNotFound)
./app/controllers/admin/causes_controller.rb:16:in
update' <internal:prelude>:10:in
synchronize'When I run the same spec using Selenium (setting the @javascript tag) the spec passes.
When run without selenium (and no options in the category_ids field selected), the params object contains:
"category_ids"=>["[""]"]
When run with selelenium, the params object contains:
"category_ids"=>[""]
I have checked the params function in the Capybara::RackTest::Form class and it appears to be correctly returning an array with a single empty string.
I also checked in the Rack::Test module, but can't discern whether the switch to an array of arrays is happening there, or within Capybara (or somewhere else, for that matter).
The text was updated successfully, but these errors were encountered: