aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/state_machine
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/test/state_machine')
-rw-r--r--activemodel/test/state_machine/event_test.rb6
-rw-r--r--activemodel/test/state_machine/machine_test.rb4
2 files changed, 6 insertions, 4 deletions
diff --git a/activemodel/test/state_machine/event_test.rb b/activemodel/test/state_machine/event_test.rb
index 01f3464cf2..7db4f8d887 100644
--- a/activemodel/test/state_machine/event_test.rb
+++ b/activemodel/test/state_machine/event_test.rb
@@ -7,7 +7,7 @@ class EventTest < ActiveModel::TestCase
end
def new_event
- @event = ActiveModel::StateMachine::Event.new(@name, {:success => @success}) do
+ @event = ActiveModel::StateMachine::Event.new(nil, @name, {:success => @success}) do
transitions :to => :closed, :from => [:open, :received]
end
end
@@ -31,7 +31,7 @@ end
class EventBeingFiredTest < ActiveModel::TestCase
test 'should raise an AASM::InvalidTransition error if the transitions are empty' do
- event = ActiveModel::StateMachine::Event.new(:event)
+ event = ActiveModel::StateMachine::Event.new(nil, :event)
assert_raises ActiveModel::StateMachine::InvalidTransition do
event.fire(nil)
@@ -39,7 +39,7 @@ class EventBeingFiredTest < ActiveModel::TestCase
end
test 'should return the state of the first matching transition it finds' do
- event = ActiveModel::StateMachine::Event.new(:event) do
+ event = ActiveModel::StateMachine::Event.new(nil, :event) do
transitions :to => :closed, :from => [:open, :received]
end
diff --git a/activemodel/test/state_machine/machine_test.rb b/activemodel/test/state_machine/machine_test.rb
index 64dea42b1f..2cdfcd9554 100644
--- a/activemodel/test/state_machine/machine_test.rb
+++ b/activemodel/test/state_machine/machine_test.rb
@@ -36,6 +36,8 @@ class StateMachineMachineTest < ActiveModel::TestCase
end
test "finds events for given state" do
- assert_equal [:shutdown, :timeout], MachineTestSubject.state_machine.events_for(:open)
+ events = MachineTestSubject.state_machine.events_for(:open)
+ assert events.include?(:shutdown)
+ assert events.include?(:timeout)
end
end \ No newline at end of file