1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/unit/initial_state_spec.rb
2015-05-15 22:50:29 +12:00

12 lines
475 B
Ruby

require 'spec_helper'
describe 'initial states' do
it 'should use the first state defined if no initial state is given' do
expect(NoInitialState.new.aasm.current_state).to eq(:read)
end
it 'should determine initial state from the Proc results' do
expect(InitialStateProc.new(InitialStateProc::RICH - 1).aasm.current_state).to eq(:selling_bad_mortgages)
expect(InitialStateProc.new(InitialStateProc::RICH + 1).aasm.current_state).to eq(:retired)
end
end