Class: ODDB::View::Drugs::TestGalenicGroupSelect

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

Defined Under Namespace

Classes: StubGalenicGroup, StubLookandfeel, StubModel, StubSession

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



73
74
75
76
77
78
79
# File 'test/test_view/drugs/galenicgroup.rb', line 73

def setup
  GalenicGroup.reset_oid
  session = StubSession.new
  model = StubModel.new
  model.galenic_group = session.galenic_groups[1]
  @select = View::Drugs::GalenicGroupSelect.new(:galenic_group, model, session) 
end

- (Object) test_to_html



80
81
82
83
# File 'test/test_view/drugs/galenicgroup.rb', line 80

def test_to_html
  expected = '<SELECT name="galenic_group"><OPTION value=":!galenic_group,2.">Salben</OPTION><OPTION selected value=":!galenic_group,1.">Tabletten</OPTION></SELECT>'
  assert_equal(expected, @select.to_html(CGI.new))
end