aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/state_machine/state_test.rb
diff options
context:
space:
mode:
authorrick <technoweenie@gmail.com>2008-06-28 09:19:44 -0700
committerrick <technoweenie@gmail.com>2008-06-28 09:19:44 -0700
commit74cb05698684f237a7eb91afadec0020d8910c70 (patch)
treeff961d9f9c2119a6608db90bc41d713a191a9b9f /activemodel/test/state_machine/state_test.rb
parentb9528ad3c5379896b00772cb44faf1db0fd882d7 (diff)
downloadrails-74cb05698684f237a7eb91afadec0020d8910c70.tar.gz
rails-74cb05698684f237a7eb91afadec0020d8910c70.tar.bz2
rails-74cb05698684f237a7eb91afadec0020d8910c70.zip
add basic events and transitions. still more tests to convert
Diffstat (limited to 'activemodel/test/state_machine/state_test.rb')
-rw-r--r--activemodel/test/state_machine/state_test.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activemodel/test/state_machine/state_test.rb b/activemodel/test/state_machine/state_test.rb
index 444435d271..22d0d9eb93 100644
--- a/activemodel/test/state_machine/state_test.rb
+++ b/activemodel/test/state_machine/state_test.rb
@@ -10,12 +10,12 @@ end
class StateTest < ActiveModel::TestCase
def setup
@name = :astate
- @options = { :crazy_custom_key => 'key' }
@machine = StateTestSubject.state_machine
+ @options = { :crazy_custom_key => 'key', :machine => @machine }
end
def new_state(options={})
- ActiveModel::StateMachine::State.new(options.delete(:machine) || @machine, @name, @options.merge(options))
+ ActiveModel::StateMachine::State.new(@name, @options.merge(options))
end
test 'sets the name' do
@@ -31,6 +31,7 @@ class StateTest < ActiveModel::TestCase
end
test 'sets the options and expose them as options' do
+ @options.delete(:machine)
assert_equal @options, new_state.options
end