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

[Validate]