Sha256: 8e43fd79492e60a7ee6558b62d0be043f1c3917b08fb2949ee2475f4125760a9

Contents?: true

Size: 587 Bytes

Versions: 2

Compression:

Stored size: 587 Bytes

Contents

require_relative 'test_helper'

class MachineWithDirtyAttributesDuringLoopbackTest < BaseTestCase
  def setup
    @model = new_model
    @machine = StateMachines::Machine.new(@model, :initial => :parked)
    @machine.event :park

    @record = @model.create

    @transition = StateMachines::Transition.new(@record, @machine, :park, :parked, :parked)
    @transition.perform(false)
  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

2 entries across 2 versions & 1 rubygems

Version Path
state_machines-activerecord-0.9.0 test/machine_with_dirty_attributes_during_loopback_test.rb
state_machines-activerecord-0.8.0 test/machine_with_dirty_attributes_during_loopback_test.rb