Class: Webrat::FileField

Inherits:
Field show all
Defined in:
lib/webrat/core/elements/field.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from Field

#value

Attributes inherited from Element

#element

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Field

#disabled?, field_class, field_classes, #id, inherited, #initialize, #label_text, load, #raise_error_if_disabled, #unset, xpath_search_excluding_hidden

Methods inherited from Element

#initialize, #inspect, load, load_all, #path

Constructor Details

This class inherits a constructor from Webrat::Field

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type.



363
364
365
# File 'lib/webrat/core/elements/field.rb', line 363

def content_type
  @content_type
end

Class Method Details

.xpath_searchObject



359
360
361
# File 'lib/webrat/core/elements/field.rb', line 359

def self.xpath_search
  ".//input[@type = 'file']"
end

Instance Method Details

#set(value, content_type = nil) ⇒ Object



365
366
367
368
# File 'lib/webrat/core/elements/field.rb', line 365

def set(value, content_type = nil)
  super(value)
  @content_type = content_type
end

#to_paramObject



370
371
372
373
374
375
376
# File 'lib/webrat/core/elements/field.rb', line 370

def to_param
  if @value.nil?
    super
  else
    replace_param_value(super, @value, test_uploaded_file)
  end
end