aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-08-06 02:40:24 +0000
committerRick Olson <technoweenie@gmail.com>2006-08-06 02:40:24 +0000
commit000a8ed9c688afe167f1d4cd4b6327d350272444 (patch)
tree7b6cff3befcf010cad8e7b86448699106ccc076c
parent26eefd79a4e9afefb3103d8332a1e7dc84ed49a1 (diff)
downloadrails-000a8ed9c688afe167f1d4cd4b6327d350272444.tar.gz
rails-000a8ed9c688afe167f1d4cd4b6327d350272444.tar.bz2
rails-000a8ed9c688afe167f1d4cd4b6327d350272444.zip
fixed lifecycle tests so they instantiate the observers
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4685 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rwxr-xr-xactiverecord/test/lifecycle_test.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/test/lifecycle_test.rb b/activerecord/test/lifecycle_test.rb
index b411524cff..2fdeb4181e 100755
--- a/activerecord/test/lifecycle_test.rb
+++ b/activerecord/test/lifecycle_test.rb
@@ -75,6 +75,7 @@ class LifecycleTest < Test::Unit::TestCase
def test_after_save
ActiveRecord::Base.observers = :topic_manual_observer
+ ActiveRecord::Base.instantiate_observers
topic = Topic.find(1)
topic.title = "hello"
@@ -86,6 +87,7 @@ class LifecycleTest < Test::Unit::TestCase
def test_observer_update_on_save
ActiveRecord::Base.observers = TopicManualObserver
+ ActiveRecord::Base.instantiate_observers
topic = Topic.find(1)
assert TopicManualObserver.instance.has_been_notified?
@@ -130,6 +132,6 @@ class LifecycleTest < Test::Unit::TestCase
end
def test_invalid_observer
- assert_raise(ArgumentError) { Topic.observers = Object.new }
+ assert_raise(ArgumentError) { Topic.observers = Object.new; Topic.instantiate_observers }
end
end