Sha256: b84b81636f05ad343c8ae74c94f038fb66504b5e0ce01abcd9be09dfe6828c61
Contents?: true
Size: 746 Bytes
Versions: 6
Compression:
Stored size: 746 Bytes
Contents
require_relative 'test_helper' class MachineWithDirtyAttributesDuringLoopbackTest < BaseTestCase def setup @model = new_model do include ActiveModel::Dirty define_attribute_methods [:state] def save super.tap do changes_applied end end end @machine = StateMachines::Machine.new(@model, initial: :parked) @machine.event :park @record = @model.create @transition = StateMachines::Transition.new(@record, @machine, :park, :parked, :parked) @transition.perform end def test_should_not_include_state_in_changed_attributes assert_equal [], @record.changed end def test_should_not_track_attribute_changes assert_nil @record.changes['state'] end end
Version data entries
6 entries across 6 versions & 1 rubygems