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
Thorsten Böttger 206b1991bc more tests
2015-06-26 19:46:58 +12:00

15 lines
581 B
Ruby

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