     el = angular.element(scroller)
     $document.append(el)
 
-    sinon.stub(fakeWindow, 'height').returns(1000)
-    scope = $rootScope.$new(true)
-    scope.scroll = sinon.spy()
-    $compile(el)(scope)
-    
-    fakeWindow.scroll()
+    scope = $rootScope.$new(true)
+    scope.scroll = sinon.spy()
+    $compile(el)(scope)
+
+    scroll(fakeWindow)
 
     $timeout.flush()
 

    el = angular.element(scroller)
    $document.append(el)

    sinon.stub(fakeWindow, 'height').returns(1000)
    scope = $rootScope.$new(true)
    scope.scroll = sinon.spy()
    $compile(el)(scope)
    
    for i in [0..2] # so, three times
      fakeWindow.scroll()

    $timeout.flush()


    el = angular.element(scroller)
    $document.append(el)

    scope = $rootScope.$new(true)
    scope.scroll = sinon.spy()
    $compile(el)(scope)
    $timeout.flush() # 'immediate' call is with $timeout ..., 0
    scope.scroll.should.not.have.been.called
    scroll(fakeWindow)
    scope.scroll.should.have.been.calledOnce

    el.remove()
