Sha256: 48032f86eff69c8e2eeaa5cd6cda99a397b7090ffd689cd9691ddfc38c176b3d
Contents?: true
Size: 805 Bytes
Versions: 6
Compression:
Stored size: 805 Bytes
Contents
require_relative 'test_helper' class MachineWithDirtyAttributeAndCustomAttributesDuringLoopbackTest < BaseTestCase def setup @model = new_model do include ActiveModel::Dirty model_attribute :status define_attribute_methods [:status] def save super.tap do changes_applied end end end @machine = StateMachines::Machine.new(@model, :status, 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['status'] end end
Version data entries
6 entries across 6 versions & 1 rubygems