Permalink
Browse files

fixed lifecycle tests so they instantiate the observers

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4685 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 26eefd7 commit 000a8ed9c688afe167f1d4cd4b6327d350272444 @technoweenie technoweenie committed Aug 6, 2006
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/test/lifecycle_test.rb
@@ -75,6 +75,7 @@ def test_before_destroy
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 @@ def test_after_save
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 @@ def test_observing_subclasses
end
def test_invalid_observer
- assert_raise(ArgumentError) { Topic.observers = Object.new }
+ assert_raise(ArgumentError) { Topic.observers = Object.new; Topic.instantiate_observers }
end
end

0 comments on commit 000a8ed

Please sign in to comment.