Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6044195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:59:03+00:00 2026-05-23T06:59:03+00:00

The following formtastic form checkbox field set: <%= semantic_form_for @store do |f| %> <%=

  • 0

The following formtastic form checkbox field set:

<%= semantic_form_for @store do |f| %>
  <%= f.inputs do %>
    <%= f.input :services, :as => :check_boxes, :collection => Service.all %>  
  <% end -%>
<% end -%>

is sending bad params for :services on a Cucumber test using Capybara, making the test fail, while the actual app sends the correct ones, which gets processed fine:

#cucumber steps using the boiler_plate capybara web_steps.rb:
Given a "Mail Order" service
...(steps for rest of the form)...
When I check "Mail Order" 
And I press "Create Store"
Then I should see "Store was successfully created."
And I should see "Mail Order"

#params sent by cucumber
"store"=>{"services"=>["[\"4d8247ed7f5bfd2275000004\"]"]

#params sent by app on manual test
"store"=>{"services"=>["4d8247ed7f5bfd2275000004"]}

Though the html form itself is rendered the same way in both cases:

<input id="store_services_4d8247ed7f5bfd2275000004" name="store[services][]" type="checkbox" value="4d8247ed7f5bfd2275000004" />

Seems like somewhere during the request params-building, the form key/value pairs for that field get parsed differently when submitted by Cucumber/Capybara.

Anyone else come across this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:59:04+00:00Added an answer on May 23, 2026 at 6:59 am

    Answering my own question:

    Got a pointer from Capybara’s author, Jonas Nicklas, that led me to this rack-test patch which hasn’t been committed yet

    For now I’m just using the fork and branch where the patch lives:

    gem 'rack-test', :git => 'https://github.com/econsultancy/rack-test.git', :branch => 'econsultancy-20110119'
    

    And that does the trick. I imagine this patch will be merged in very soon though, as it was submitted a couple of months ago.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a form in Rails3 and Formtastic. I have the following field: <%=
I have a formtastic form like the following: = semantic_form_for @record, :remote => true,
I have the following form with Formtastic: = semantic_form_for @user, :url=> url_for(register_path), :html =>
I have this formtastic field in a form where an user input his credit
I am trying to set up a form using Formtastic which has a drop
I am using the following for a check-box on a form: = f.input :post_linkedin,
With the following Store and Service models, managed with MongoMapper: class Store include MongoMapper::Document
When you do the following: form.input :users And the attribute #users represents a has_many
Following on from my recent question on Large, Complex Objects as a Web Service
Following on from the question asked by Mykroft Best way to handle input from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.