Sha256: c8442bea1acedb3e34a99e386699a0f11e023fd4655aeeb7bc2e3643b3e36f97
Contents?: true
Size: 601 Bytes
Versions: 13
Compression:
Stored size: 601 Bytes
Contents
require_relative 'test_helper' class MachineWithDirtyAttributeAndStateEventsTest < BaseTestCase def setup @model = new_model do include ActiveModel::Dirty define_attribute_methods [:state] end @machine = StateMachines::Machine.new(@model, action: :save, initial: :parked) @machine.event :ignite @record = @model.create @record.state_event = 'ignite' end def test_should_not_include_state_in_changed_attributes assert_equal [], @record.changed end def test_should_not_track_attribute_change assert_equal nil, @record.changes['state'] end end
Version data entries
13 entries across 13 versions & 2 rubygems