
webrat, rspec 2, rails 3, and checkboxes
Reported by Paul Sadauskas (Rando) | February 22nd, 2010 @ 09:21 PM
I don't know if this is even the right issue tracker to report this to. Essentially, rspec-rails 2 pulls in Webrat for integration specs automatically. However, it configures it as rack:
Webrat.configure do |config|
config.mode = :rack
end
Which is probably for the best, because mode = :rails just
explodes in Rails3. However, this causes Webrat::Field#to_param to
not use the rails param hash => query string helper, and instead
use a simple one. This becomes an issue when using a rails form
with multiple checkboxes of the same name, like
foo[bar][]
. The simplified webrat param maker just
uses the first value from the value array, instead of setting them
all.
I think the best solution would be to either add another
when
to the case
statement:
when :rails
Rack::Utils.parse_nested_query("#{name}=#{escaped_value}")
or just make using Rack::Utils be the default case, since we can probably expect it to be available in all cases.
Comments and changes to this ticket
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Ruby Acceptance Testing for Web applications.