Class: ODDB::View::TestDescription

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_view/descriptionform.rb

Defined Under Namespace

Classes: StubExtendedDescriptionForm, StubExtension, StubLookandfeel, StubModel, StubSession

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



85
86
87
88
89
# File 'test/test_view/descriptionform.rb', line 85

def setup
  model = StubModel.new
  session = StubSession.new
  @form = StubExtendedDescriptionForm.new(model, session)
end

- (Object) test_extended



104
105
106
107
# File 'test/test_view/descriptionform.rb', line 104

def test_extended
  result = @form.to_html(CGI.new)
  assert(result.index("extended!"), "Expected: 'extended!' in: \n#{result}")
end

- (Object) test_to_html



90
91
92
93
94
95
96
# File 'test/test_view/descriptionform.rb', line 90

def test_to_html
  expected = "<LABEL for=\"de\">Deutsch</LABEL>\n<INPUT name=\"de\" type=\"text\" value=\"foo\">\n<LABEL for=\"fr\">Franz&ouml;sisch</LABEL>\n<INPUT name=\"fr\" type=\"text\" value=\"bar\">\n<INPUT name=\"update\" type=\"submit\" value=\"Speichern\">\n"
  result = @form.to_html(CGI.new)
  expected.each { |line| 
    assert(result.index(line.strip!),"Expected: \n#{line}\nin:\n#{result}")
  }
end