Fix Active Model observer tests
This commit is contained in:
parent
2161b8745a
commit
1924cff934
|
@ -52,6 +52,10 @@ module ActiveModel
|
|||
end
|
||||
end
|
||||
|
||||
def count_observers
|
||||
@observer_instances.size
|
||||
end
|
||||
|
||||
protected
|
||||
def instantiate_observer(observer) #:nodoc:
|
||||
# string/symbol
|
||||
|
|
|
@ -121,13 +121,11 @@ class ObserverTest < ActiveModel::TestCase
|
|||
foo = Foo.new
|
||||
FooObserver.instance.stub = stub
|
||||
FooObserver.instance.stub.expects(:event_with).with(foo)
|
||||
Foo.send(:changed)
|
||||
Foo.send(:notify_observers, :on_spec, foo)
|
||||
end
|
||||
|
||||
test "skips nonexistent observer event" do
|
||||
foo = Foo.new
|
||||
Foo.send(:changed)
|
||||
Foo.send(:notify_observers, :whatever, foo)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue