Class: MachineCollectionFireImplicitNestedPartialTest

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



687
688
689
690
691
692
693
694
695
696
697
# File 'lib/branston/vendor/plugins/state_machine/test/unit/machine_collection_test.rb', line 687

def setup
  super
  
  @partial_result = nil
  
  @object.state_event = 'ignite'
  @result = @machines.fire_event_attributes(@object, :save) do
    @partial_result = @machines.fire_event_attributes(@object, :save, false) { true }
    true
  end
end

#test_should_be_successfulObject



699
700
701
# File 'lib/branston/vendor/plugins/state_machine/test/unit/machine_collection_test.rb', line 699

def test_should_be_successful
  assert @result
end

#test_should_have_successful_partial_fireObject



703
704
705
# File 'lib/branston/vendor/plugins/state_machine/test/unit/machine_collection_test.rb', line 703

def test_should_have_successful_partial_fire
  assert @partial_result
end

#test_should_reset_event_attributeObject



711
712
713
# File 'lib/branston/vendor/plugins/state_machine/test/unit/machine_collection_test.rb', line 711

def test_should_reset_event_attribute
  assert_nil @object.state_event
end

#test_should_reset_event_transition_attributeObject



715
716
717
# File 'lib/branston/vendor/plugins/state_machine/test/unit/machine_collection_test.rb', line 715

def test_should_reset_event_transition_attribute
  assert_nil @object.send(:state_event_transition)
end

#test_should_transition_stateObject



707
708
709
# File 'lib/branston/vendor/plugins/state_machine/test/unit/machine_collection_test.rb', line 707

def test_should_transition_state
  assert_equal 'idling', @object.state
end