123456789_123456789_123456789_123456789_123456789_

Class: Capybara::RackTest::Form::NilUploadedFile

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Rack::Test::UploadedFile
Instance Chain:
self, Rack::Test::UploadedFile
Inherits: Rack::Test::UploadedFile
  • Object
Defined in: lib/capybara/rack_test/form.rb

Overview

This only needs to inherit from Rack::Test::UploadedFile because Rack::Test checks for the class specifically when determining whether to construct the request as multipart. That check should be based solely on the form element’s ‘enctype’ attribute value, which should probably be provided to Rack::Test in its non-GET request methods.

Class Method Summary

Instance Method Summary

Constructor Details

.newNilUploadedFile

[ GitHub ]

  
# File 'lib/capybara/rack_test/form.rb', line 9

def initialize # rubocop:disable Lint/MissingSuper
  @empty_file = Tempfile.new('nil_uploaded_file')
  @empty_file.close
end

Instance Method Details

#append_to(_)

[ GitHub ]

  
# File 'lib/capybara/rack_test/form.rb', line 19

def append_to(_); end

#content_type

[ GitHub ]

  
# File 'lib/capybara/rack_test/form.rb', line 15

def content_type; 'application/octet-stream'; end

#original_filename

[ GitHub ]

  
# File 'lib/capybara/rack_test/form.rb', line 14

def original_filename; ''; end

#path

[ GitHub ]

  
# File 'lib/capybara/rack_test/form.rb', line 16

def path; @empty_file.path; end

#read

[ GitHub ]

  
# File 'lib/capybara/rack_test/form.rb', line 18

def read; ''; end

#set_encoding(_)

[ GitHub ]

  
# File 'lib/capybara/rack_test/form.rb', line 20

def set_encoding(_); end # rubocop:disable Naming/AccessorMethodName

#size

[ GitHub ]

  
# File 'lib/capybara/rack_test/form.rb', line 17

def size; 0; end