fixed lifecycle tests so they instantiate the observers

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4685 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Rick Olson
2006-08-06 02:40:24 +00:00
parent 26eefd79a4
commit 000a8ed9c6

View File

@@ -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