title: Capybara::ElementNotFound: Unable to find file field "file"
body: <p>I am testing file upload i.e CSV. In my code as well as browser HTML I found file field but while testing the capybara is unable to find the file field. I tried hard and different approaches but unable to fix the problem. Here partial look like this:</p>
  
  <pre><code>#add_file_box
    %div.msg
    %h1.page-header
      = "Upload a CSV"
    %h4.title
  
    = form_tag dummy_path, multipart: true, class: "upload_csv" do
      = hidden_field_tag :dmp_id, @dmp.id
      .form-group
        .input-group
          %span.input-group-btn
            %span.btn.btn-primary.btn-file
              Choose file
              = file_field_tag :file, style: 'line-height: normal',  accept: "text/csv", class: "file_input"
          %input.form-control.input-custom{:readonly =&gt; "", :type =&gt; "text"}
      .form-group
        = submit_tag "Upload CSV", class: "btn btn-primary", id: "upload_csv"
  </code></pre>
  
  <p>And capybara test look like this</p>
  
  <pre><code> within '.upload_csv' do
       page.attach_file('file', "#{Rails.root}/spec/acceptance/test_uploads/input_output.csv")
       click_button 'Upload'
     end
  </code></pre>
  
  <p>I will be thankful if you can help me fixing this problem?</p>