Sha256: 7ffc79474481942ee00e5b26a09c0aa9d5717ac3f46cb67eebf4a226c6de4014

Contents?: true

Size: 570 Bytes

Versions: 13

Compression:

Stored size: 570 Bytes

Contents

require "webrat/core/elements/element"

module Webrat
  class Label < Element #:nodoc:
    
    attr_reader :element
    
    def self.xpath_search
      ".//label"
    end

    def for_id
      Webrat::XML.attribute(@element, "for")
    end
    
    def field
      Field.load(@session, field_element)
    end
    
  protected
  
    def field_element
      if for_id.blank?
        Webrat::XML.xpath_at(@element, *Field.xpath_search_excluding_hidden)
      else
        Webrat::XML.css_search(@session.current_dom, "#" + for_id).first
      end
    end
    
  end
end

Version data entries

13 entries across 13 versions & 8 rubygems

Version Path
diabolo-webrat-0.4.2 lib/webrat/core/elements/label.rb
hectoregm-webrat-0.4.2 lib/webrat/core/elements/label.rb
jferris-webrat-0.4.3.0.1238640835 lib/webrat/core/elements/label.rb
jferris-webrat-0.4.3 lib/webrat/core/elements/label.rb
jwilger-webrat-0.4.3.2 lib/webrat/core/elements/label.rb
jwilger-webrat-0.4.3.3 lib/webrat/core/elements/label.rb
jwilger-webrat-0.4.3.4 lib/webrat/core/elements/label.rb
mattwynne-cucover-0.1.0 examples/self_test/rails/vendor/gems/webrat-0.4.4/lib/webrat/core/elements/label.rb
mattwynne-cucover-0.1.1 examples/self_test/rails/vendor/gems/webrat-0.4.4/lib/webrat/core/elements/label.rb
mmurphy-webrat-0.4.4 lib/webrat/core/elements/label.rb
integrity-0.1.9 vendor/webrat/lib/webrat/core/elements/label.rb
webrat-0.4.3 lib/webrat/core/elements/label.rb
webrat-0.4.4 lib/webrat/core/elements/label.rb