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 382
382:     def initialize(select, tag)
383:       @select, @tag = select, tag
384:       @initially_selected = tag['selected']
385:       content = tag.children.to_s
386:       value = tag['value']
387:       if value && value != content # Like <option value="7">United States</option>
388:         @label = content
389:         @value = value
390:       else # Label is nil if like <option>United States</option> or value == content
391:         @value = content
392:       end
393:     end

[Validate]