diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-02-17 22:52:55 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-02-17 22:52:55 +0000 |
commit | 23e58a0552b4febd9372ee4642b0da886d92fd7a (patch) | |
tree | c543dd999b439f814daac060098e5d98758102ee /activerecord/test/cases | |
parent | 5457770a36deef3047e37b5e5737b3fbc4705b00 (diff) | |
download | rails-23e58a0552b4febd9372ee4642b0da886d92fd7a.tar.gz rails-23e58a0552b4febd9372ee4642b0da886d92fd7a.tar.bz2 rails-23e58a0552b4febd9372ee4642b0da886d92fd7a.zip |
Fix observed_class. References #11099.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8889 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/cases')
-rwxr-xr-x | activerecord/test/cases/lifecycle_test.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/activerecord/test/cases/lifecycle_test.rb b/activerecord/test/cases/lifecycle_test.rb index 5800806e9e..0df7f4690d 100755 --- a/activerecord/test/cases/lifecycle_test.rb +++ b/activerecord/test/cases/lifecycle_test.rb @@ -26,7 +26,7 @@ class TopicManualObserver end end -class TopicaObserver < ActiveRecord::Observer +class TopicaAuditor < ActiveRecord::Observer observe :topic attr_reader :topic @@ -95,7 +95,9 @@ class LifecycleTest < ActiveRecord::TestCase end def test_auto_observer - topic_observer = TopicaObserver.instance + topic_observer = TopicaAuditor.instance + assert_nil TopicaAuditor.observed_class + assert_equal [Topic], TopicaAuditor.instance.observed_classes.to_a topic = Topic.find(1) assert_equal topic.title, topic_observer.topic.title @@ -103,6 +105,7 @@ class LifecycleTest < ActiveRecord::TestCase def test_inferred_auto_observer topic_observer = TopicObserver.instance + assert_equal Topic, TopicObserver.observed_class topic = Topic.find(1) assert_equal topic.title, topic_observer.topic.title @@ -134,8 +137,4 @@ class LifecycleTest < ActiveRecord::TestCase def test_invalid_observer assert_raise(ArgumentError) { Topic.observers = Object.new; Topic.instantiate_observers } end - - def test_getting_observed_class_from_class_name - assert_equal Topic, TopicObserver.observed_class - end end |