 
       @_createApp({}).then (app) =>
 
-        configTests = testsSpy.getCall(0).returnValue
+        configTests = testsSpy.firstCall.returnValue
         expect(configTests.title).toBe "33% Tests Passing"
         expect(configTests.subtitle).toBe "(3 of 9)"
         expect(configTests.status).toBe "pending"


      Rally.environment.getMessageBus().publish(Rally.Message.objectUpdate, Rally.test.mock.ModelObjectMother.getRecord('Release'))

      expect(addContentSpy.callCount).toBe 0

  it "only gets tzOffset and scheduleStates once", ->
    httpGetSpy = @spy(Rally.env.IoProvider.prototype, 'httpGet')
    @_createApp({}).then (app) =>

      addContentSpy = @spy(app, 'addContent')
      componentReadyListenter = @stub()

      expect(httpGetSpy.callCount).toBe 1

      modelsSpy = @spy(Rally.data.ModelFactory, 'getModels')
      modelSpy = @spy(Rally.data.ModelFactory, 'getModel')

      messageBus = Rally.environment.getMessageBus()
      messageBus.subscribe(Rally.BrowserTest.getComponentReadyMessageName(app), componentReadyListenter)
      messageBus.publish(Rally.Message.objectUpdate, Rally.test.mock.ModelObjectMother.getRecord('HierarchicalRequirement'))
      @waitForCallback(componentReadyListenter).then =>

        expect(httpGetSpy.callCount).toBe 1
        expect(addContentSpy.callCount).toBe 1

        # 8 because there are four artifact types getting loaded, and each
        # one calls getModel twice, if more than 8, then the getModel call
        # to get schedule states happened again, meaning the test failed
        expect(modelsSpy).toHaveBeenCalledOnce()
        expect(modelSpy).not.toHaveBeenCalled()

  it "rounds estimates to two decimal places", ->
    @ajax.whenQuerying('defectsuite').respondWith()

]

describe 'Rally.apps.iterationsummary.IterationSummaryApp', ->
  helpers
    _getContext: (initialValues) ->
      globalContext = Rally.environment.getContext()

      Ext.create('Rally.app.Context', {
        initialValues:Ext.merge({
          project:globalContext.getProject()
          workspace:globalContext.getWorkspace()
