state_machines-activerecord icon indicating copy to clipboard operation
state_machines-activerecord copied to clipboard

Transition specs fails when switching to state_machines-activerecord

Open RemyMaucourt opened this issue 7 years ago • 1 comments

I started with state_machines, and wrote a few specs about my workflow with state_machines-rspec.

When I decided later to switch to state_machines-activerecord, my transition specs failed, and I can't see why. That kind of spec:

it { is_expected.to transition_from :idle, to_state: :received, on_event: :receive }

generates that kind of error:

Failure/Error:
    is_expected.to transition_from :idle, to_state: :received,
                                             on_event: :receive

Expected to be able to transition state from: idle to: received, on_event: receive

which is weird, considering I have this code in my model:

event :receive do
    transition idle: :received
end

Is there something I should know about the config of the rspec gem?

(I'm building a Rails 5.1 app)

RemyMaucourt avatar Nov 06 '17 14:11 RemyMaucourt

I'm not an user of RSpec so I recommend you to open this issue in the RSpec adapter since they would be more likely to work on it.

rafaelfranca avatar Nov 06 '17 16:11 rafaelfranca