From dc74f0cb1bdbb07accc9412644ff4d30803218a7 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Mon, 30 Apr 2012 14:20:42 -0400 Subject: notify_observers should be public --- activemodel/test/cases/observing_test.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'activemodel/test/cases') 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 -- cgit v1.2.3