Class: MachineCollectionFireImplicitWithCustomMachineNameTest

Inherits:
MachineCollectionFireImplicitTest show all
Defined in:
lib/branston/vendor/plugins/state_machine/test/unit/machine_collection_test.rb

Instance Method Summary collapse

Methods inherited from MachineCollectionFireImplicitTest

#default_test

Instance Method Details

#setupObject



844
845
846
847
848
# File 'lib/branston/vendor/plugins/state_machine/test/unit/machine_collection_test.rb', line 844

def setup
  super
  
  @object.state_event = 'ignite'
end

#test_should_be_successful_on_complete_fileObject



850
851
852
853
854
855
# File 'lib/branston/vendor/plugins/state_machine/test/unit/machine_collection_test.rb', line 850

def test_should_be_successful_on_complete_file
  assert @machines.fire_event_attributes(@object, :save) { true }
  assert_equal 'idling', @object.state
  assert_nil @object.state_event
  assert_nil @object.send(:state_event_transition)
end

#test_should_be_successful_on_partial_fireObject



857
858
859
860
861
862
# File 'lib/branston/vendor/plugins/state_machine/test/unit/machine_collection_test.rb', line 857

def test_should_be_successful_on_partial_fire
  @machines.fire_event_attributes(@object, :save, false) { true }
  assert_equal 'idling', @object.state
  assert_nil @object.state_event
  assert_not_nil @object.send(:state_event_transition)
end