Skip to content

Does not respond to field other than state #3

@supertracer

Description

@supertracer

I am using a field current_state instead of traditional state field for state machine

field :current_state, type: String
state_machine :current_state, :initial => :scheduled do
    event :patient_arrived do
      transition :scheduled => :waiting
    end
    event :patient_engaged do
      transition :waiting => :engaged
    end
    event :patient_seen do
      transition [:scheduled, :waiting, :engaged] => :seen
    end
    event :undo_arrived do
      transition :waiting => :scheduled
    end
  end

It is throwing error
Failure/Error: it { should have_states :scheduled, :waiting, :engaged, :seen }
Expected state to allow states: scheduled, waiting, engaged, seen

However if i change my field from 'current_state' to 'state' my test case passes.
I could not find any documentation to handle this, is this an issue or is there some workaround

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions