# Testing post :action with an array in the parameters

**URL:** <https://www.ruby-forum.com/t/testing-post-action-with-an-array-in-the-parameters/107379>\
**Category:** Rails\
**Created:** [June 21, 2007, 1:37am UTC](https://www.ruby-forum.com/t/testing-post-action-with-an-array-in-the-parameters/107379 "2007-06-21T01:37:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephanie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@stephanie](https://www.ruby-forum.com/u/stephanie)\
**Post date:** [June 21, 2007, 1:37am UTC](https://www.ruby-forum.com/t/testing-post-action-with-an-array-in-the-parameters/107379/1 "2007-06-21T01:37:00Z")

</div>

Hi,

I have a html form with check boxes. When the user chooses one or more  
check boxes, an array is passed as a parameter to the controller.

in html form page…  
  
\<%= name %\>

in controller  
params[:myarray] # this in an array of all the values checked

This works great, but I am having trouble replicating the post in my  
tests. Does anybody know how to pass an array in a post test?

This gives me a routing error…

post :create, {:myarray =\> ['value1, ‘value2’] }

Thanks,  
Stephanie

---

<div class="post-metadata">

**Author:** ![stephanie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@stephanie](https://www.ruby-forum.com/u/stephanie)\
**Post date:** [June 21, 2007, 2:26am UTC](https://www.ruby-forum.com/t/testing-post-action-with-an-array-in-the-parameters/107379/2 "2007-06-21T02:26:03Z")

</div>

After further tinkering I realized that is passing the array. The  
routing error was within the action, not the creation of the test  
post. Sorry for the list traffic.

-Stephanie
