Sha256: 4fb7adfbaadd222b9464ba3e62d175847a0697c296300ab7edfd91a89bdca57e

Contents?: true

Size: 534 Bytes

Versions: 2

Compression:

Stored size: 534 Bytes

Contents

class EnumValuesInMemoryTest < ActiveRecordTestCase
  test 'that the value of the state is persisted instead of the name' do 

    class EnumFlow
      attr_reader :workflow_state
      include Workflow

      workflow do
        state :first, 1 do
          event :forward, :transitions_to => :second
        end
        state :second, 2 do
          event :back, :transitions_to => :first
        end
      end
    end

    flow = EnumFlow.new
    flow.forward!
    assert flow.workflow_state == 2
    assert flow.second?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
workflow-orchestrator-1.3.1 test/enum_values_in_memory_test.rb
workflow-orchestrator-1.3.0 test/enum_values_in_memory_test.rb