Sha256: 44b21fbb2642b9db4a730cb8466eab00796d81f9c9c4c6310729b78f1ec70f21

Contents?: true

Size: 520 Bytes

Versions: 3

Compression:

Stored size: 520 Bytes

Contents

require_relative 'test_helper'

class MachineWithDirtyAttributeAndStateEventsTest < BaseTestCase
  def setup
    @model = new_model
    @machine = StateMachines::Machine.new(@model, :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.send(:attribute_change, 'state')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
state_machines-mongoid-0.2.0 test/machine_with_dirty_attribute_and_state_events_test.rb
state_machines-mongoid-0.1.1 test/machine_with_dirty_attribute_and_state_events_test.rb
state_machines-mongoid-0.1.0 test/machine_with_dirty_attribute_and_state_events_test.rb