Sha256: 529996ca6b8b2ab2d14d8bc66c4d1730e087100347a4433218fdfad4a9d46d33

Contents?: true

Size: 594 Bytes

Versions: 14

Compression:

Stored size: 594 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_equal nil, @record.changes['state']
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
state_machines-activerecord-0.6.0 test/machine_with_dirty_attributes_during_loopback_test.rb
state_machines-activerecord-0.5.2 test/machine_with_dirty_attributes_during_loopback_test.rb
state_machines-activerecord-0.5.1 test/machine_with_dirty_attributes_during_loopback_test.rb
state_machines-activerecord-0.5.0 test/machine_with_dirty_attributes_during_loopback_test.rb
state_machines-activerecord-0.4.1 test/machine_with_dirty_attributes_during_loopback_test.rb
state_machines-activerecord-0.4.0 test/machine_with_dirty_attributes_during_loopback_test.rb
state_machines-activerecord-0.4.0.pre test/machine_with_dirty_attributes_during_loopback_test.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/state_machines-activerecord-0.2.0/test/machine_with_dirty_attributes_during_loopback_test.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/state_machines-activerecord-0.2.0/test/machine_with_dirty_attributes_during_loopback_test.rb
state_machines-activerecord-0.3.0 test/machine_with_dirty_attributes_during_loopback_test.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/state_machines-activerecord-0.2.0/test/machine_with_dirty_attributes_during_loopback_test.rb
state_machines-activerecord-0.2.0 test/machine_with_dirty_attributes_during_loopback_test.rb
state_machines-activerecord-0.1.0 test/machine_with_dirty_attributes_during_loopback_test.rb
state_machines-activerecord-0.0.1 test/machine_with_dirty_attributes_during_loopback_test.rb