pluginaweek/state_machine — Issue #163: Rspec and state_machine
Author: popdevelop
Created: 2012-02-21 16:26:21+00:00
State: open

I have the following state machine

class Test < ActiveRecord::Base
def end_call
# Called twice
end

state_machine :state, :initial => :brand_new do
after_transition :to => :end, :do => :end_call

event :start do
transition :start => :end
end
end
end

and the following test in rspec

Test = Factory(:test)
test.start!

What happens is that end_call gets called twice. Do now its probably not an issue here. But googled everywhere and couldnt find an answer. Probably more people having the same problem as med out there.