# Testing for Form Submission?

**URL:** <https://www.ruby-forum.com/t/testing-for-form-submission/197072>\
**Category:** Rails\
**Created:** [April 2, 2008, 5:24pm UTC](https://www.ruby-forum.com/t/testing-for-form-submission/197072 "2008-04-02T17:24:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [April 2, 2008, 5:24pm UTC](https://www.ruby-forum.com/t/testing-for-form-submission/197072/1 "2008-04-02T17:24:56Z")

</div>

Hi-

I’m trying to create a file upload script using RoR but I am getting  
“You have a nil object when you didn’t expect it!” and I think this is  
caused by the fact that the no form has been submitted. Is that  
right?

Here’s the form:

\<% form\_for :dump, :url =\> { :controller =\> “mycontroller”, :action=\>  
“csv\_reader” }, :html =\> { :multipart =\> true } do |f| -%\>

| **_Select a CSV File:_** | \<%= file\_field\_tag 'file' %\> |
| \<%= submit\_tag "Submit" %\> |

\<% end %\>

Thanks!
