Kaynağa Gözat

Fix callback defined in wrong describe block scope

Alasdair Smith 8 yıl önce
ebeveyn
işleme
d79e226a20

+ 5 - 3
services/web/test/unit/coffee/References/ReferencesControllerTests.coffee

@@ -142,13 +142,15 @@ describe "ReferencesController", ->
 
 	describe 'index', ->
 
+		beforeEach ->
+			@call = (callback) =>
+				@controller.index @req, @res
+				callback()
+
 		describe 'with docIds as an array and shouldBroadcast as false', ->
 
 			beforeEach ->
 				@ReferencesHandler.index.callsArgWith(2, null, @fakeResponseData)
-				@call = (callback) =>
-					@controller.index @req, @res
-					callback()
 
 			it 'should call ReferencesHandler.index', (done) ->
 				@call () =>