Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition specs fails when switching to state_machines-activerecord #64

Open
RemyMaucourt opened this issue Nov 6, 2017 · 1 comment

Comments

@RemyMaucourt
Copy link

RemyMaucourt commented Nov 6, 2017

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 RemyMaucourt changed the title specs fails when switching to state_machines-activerecord Transition specs fails when switching to state_machines-activerecord Nov 6, 2017
@rafaelfranca
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants