class ActiveRecordTest::MachineWithDefaultScope
Public Instance Methods
setup()
click to toggle source
# File test/unit/integrations/active_record_test.rb, line 1948 def setup @model = new_model @machine = StateMachine::Machine.new(@model, :initial => :parked) @machine.state :idling @model.class_eval do default_scope with_state(:parked, :idling) end end
test_should_set_initial_state_on_created_object()
click to toggle source
# File test/unit/integrations/active_record_test.rb, line 1958 def test_should_set_initial_state_on_created_object object = @model.new assert_equal 'parked', object.state end