class ActiveModelTest::MachineWithDynamicInitialStateTest

Public Instance Methods

setup() click to toggle source
# File test/unit/integrations/active_model_test.rb, line 155
def setup
  @model = new_model
  @machine = StateMachine::Machine.new(@model, :initial => lambda {|object| :parked}, :integration => :active_model)
  @machine.state :parked
end
test_should_set_initial_state_on_created_object() click to toggle source
# File test/unit/integrations/active_model_test.rb, line 161
def test_should_set_initial_state_on_created_object
  record = @model.new
  assert_equal 'parked', record.state
end