Method: Webrat::FileField#test_uploaded_file

Defined in:
lib/webrat/core/elements/field.rb

#test_uploaded_fileObject



348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/webrat/core/elements/field.rb', line 348

def test_uploaded_file
  return "" if @original_value.blank?

  case Webrat.configuration.mode
  when :rails
    if content_type
      ActionController::TestUploadedFile.new(@original_value, content_type)
    else
      ActionController::TestUploadedFile.new(@original_value)
    end
  when :rack, :merb
    Rack::Test::UploadedFile.new(@original_value, content_type)
  end
end