Class FormTestHelper::Option
In: lib/form_test_helper.rb
Parent: Object

Methods

new  

Attributes

initially_selected  [R] 
label  [R] 
tag  [R] 
value  [R] 

Public Class methods

[Source]

     # File lib/form_test_helper.rb, line 422
422:     def initialize(select, tag)
423:       @select, @tag = select, tag
424:       @initially_selected = tag['selected']
425:       content = tag.children.to_s
426:       value = tag['value']
427:       if value && value != content # Like <option value="7">United States</option>
428:         @label = content
429:         @value = value
430:       else # Label is nil if like <option>United States</option> or value == content
431:         @value = content
432:       end
433:     end

[Validate]