Class: ODDB::State::Drugs::TestGalenicGroup

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

Defined Under Namespace

Classes: StubApp, StubGalenicForm, StubPointer, StubResolved, StubSession

Instance Method Summary (collapse)

Instance Method Details

- (Object) test_pass_galenic_group



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'test/test_state/drugs/galenicgroup.rb', line 55

def test_pass_galenic_group
  session = StubSession.new
  model = StubGalenicForm.new
  state = State::Drugs::GalenicGroup.new(session, model)
  pointer = StubPointer.new
  pointer.model = model
  model.pointer = pointer
  state.extend(State::Admin::Root)
  session.user_input = {
    :pointer =>  pointer,
  }
  newstate = state.trigger(:new_galenic_form)
  assert_respond_to(newstate.model, :galenic_group)
  assert_equal(model, newstate.model.galenic_group)
end