aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/observing_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2012-04-30 19:18:10 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2012-04-30 19:18:10 -0700
commitcb5b0cf93ff45c3f08ac6b6ce524846419275067 (patch)
treebf98f86f655d73134f90f7601bacd0ea548b641d /activemodel/test/cases/observing_test.rb
parent206b43a954dc6c6c0b4b3916cade2561413efdb5 (diff)
parentdc74f0cb1bdbb07accc9412644ff4d30803218a7 (diff)
downloadrails-cb5b0cf93ff45c3f08ac6b6ce524846419275067.tar.gz
rails-cb5b0cf93ff45c3f08ac6b6ce524846419275067.tar.bz2
rails-cb5b0cf93ff45c3f08ac6b6ce524846419275067.zip
Merge pull request #6093 from marcandre/observer_public
notify_observers should be public
Diffstat (limited to 'activemodel/test/cases/observing_test.rb')
-rw-r--r--activemodel/test/cases/observing_test.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/activemodel/test/cases/observing_test.rb b/activemodel/test/cases/observing_test.rb
index c91938a7ee..ade6026602 100644
--- a/activemodel/test/cases/observing_test.rb
+++ b/activemodel/test/cases/observing_test.rb
@@ -138,7 +138,14 @@ class ObserverTest < ActiveModel::TestCase
foo = Foo.new
FooObserver.instance.stub = stub
FooObserver.instance.stub.expects(:event_with).with(foo)
- Foo.send(:notify_observers, :on_spec, foo)
+ Foo.notify_observers(:on_spec, foo)
+ end
+
+ test "calls existing observer event from the instance" do
+ foo = Foo.new
+ FooObserver.instance.stub = stub
+ FooObserver.instance.stub.expects(:event_with).with(foo)
+ foo.notify_observers(:on_spec)
end
test "passes extra arguments" do
@@ -150,7 +157,7 @@ class ObserverTest < ActiveModel::TestCase
test "skips nonexistent observer event" do
foo = Foo.new
- Foo.send(:notify_observers, :whatever, foo)
+ Foo.notify_observers(:whatever, foo)
end
test "update passes a block on to the observer" do