rspec-file_fixtures

0.1.9
Light Mode Dark Mode

Upload

Create a Rack::Test::UploadedFile instance by calling #upload(content_type: 'image/png') (e.g.).

The returned object can be passed as a parameter in a request spec to simulate uploading a file.

subject { fixture('example.xml').upload(content_type: 'application/xml') }

it { is_expected.to be_a Rack::Test::UploadedFile }
#<Rack::Test::UploadedFile:0x0000560e12814bd0
@content_type="application/xml",
@original_filename="example.xml",
@tempfile=#<File:/tmp/example20231102-4192070-v9vouw.xml>>

Documentation generated by rspec-documentation