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_multiple_spec.rb

16 lines
581 B
Ruby
Raw Normal View History

2015-06-26 03:46:58 -04:00
require 'spec_helper'
describe 'initial states' do
it 'should use the first state defined if no initial state is given' do
expect(NoInitialStateMultiple.new.aasm(:left).current_state).to eq(:read)
end
it 'should determine initial state from the Proc results' do
balance = InitialStateProcMultiple::RICH - 1
expect(InitialStateProcMultiple.new(balance).aasm(:left).current_state).to eq(:selling_bad_mortgages)
balance = InitialStateProcMultiple::RICH + 1
expect(InitialStateProcMultiple.new(balance).aasm(:left).current_state).to eq(:retired)
end
end