Hi,

In our app we have an API and we're creating a new method in one of 
controller to allow file upload. We created a test like this:

 it 'should upload and save a zip file with invoices' do
    zip = File.read('spec/support/zip-rails.zip')
        
    post :upload, registry: "11222333000144", file: zip

    response.body.should eql(true.to_s)
  end

However, when we run the tests, we getting the following error:

ArgumentError:
       invalid byte sequence in UTF-8

We have already searched and most of results tell about set content-type to  
'multipart/form-data'. 
We don't know if is it, but we tryied set content-type by many and 
different ways and the error is still there.

Do somebody know about this??

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/7c1c07f5-ed27-4fff-8151-97cda7e184e7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to