Class: ODDB::View::TestNavigationFoot

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

Defined Under Namespace

Classes: StubApp, StubLookandfeel, StubSession

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



81
82
83
84
85
86
87
88
89
90
91
# File 'test/test_view/navigationfoot.rb', line 81

def setup
  GalenicGroup.reset_oid
  @app = StubApp.new
  @app.last_update = Time.now
  @session = StubSession.new
  @session.flavor = 'gcc'
  @session.language = 'de'
  @session.app = @app
  @session.lookandfeel = StubLookandfeel.new(@session)
  @view = View::NavigationFoot.new(nil, @session)
end

- (Object) test_to_html



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'test/test_view/navigationfoot.rb', line 92

def test_to_html
  result = ''
  assert_nothing_raised {
    result << @view.to_html(CGI.new)
  }
  expected = [
    '<TABLE cellspacing="0" class="navigation">',
    '<TD><A name="foo" class="navigation right">Foo</A></TD>',
    '<TD>&nbsp;|&nbsp;</TD>',
    '<TD><A name="bar" href="http://test.oddb.org/de/gcc/bar/" class="subheading">Bar</A></TD>',
    '<TD><A name="baz" href="http://test.oddb.org/de/gcc/baz/" class="subheading">Baz</A></TD>',
  ]
  expected.each { |line|
    assert(result.index(line), "expected #{line} in \n#{result}")
  }
end