 
       testsSpy = @spy(Rally.apps.iterationsummary.IterationSummaryApp.prototype, '_getTestsConfigObject')
 
-      @_createApp({}).then (app) =>
+      @createApp({}).then (app) =>
 
         configTests = testsSpy.firstCall.returnValue
         expect(configTests.title).toBe "33% Tests Passing"


      testsSpy = @spy(Rally.apps.iterationsummary.IterationSummaryApp.prototype, '_getTestsConfigObject')

      @_createApp({}).then (app) =>

        configTests = testsSpy.firstCall.returnValue
        expect(configTests.title).toBe "33% Tests Passing"

    )
    displayStatusRowsSpy = @spy(Rally.apps.iterationsummary.IterationSummaryApp.prototype, '_displayStatusRows')

    @createApp({}).then (app) =>

      expect(displayStatusRowsSpy).not.toHaveBeenCalled()

  it "calls wsapidatastore if models are available", ->
    displayStatusRowsSpy = @spy(Rally.apps.iterationsummary.IterationSummaryApp.prototype, '_displayStatusRows')

    @createApp({}).then (app) =>

      @waitForCallback(displayStatusRowsSpy)

  it "getPostAcceptedState with no before or after state", ->
    @ajax.whenQueryingAllowedValues('userstory', 'ScheduleState').respondWith ["Defined", "In-Progress", "Completed", "Accepted"]
    @createApp({}).then (app) =>
      app._getPostAcceptedState().always (postAcceptedState) ->
        expect(postAcceptedState).toBeNull()

  it "getPostAcceptedState with only a before state", ->
    @ajax.whenQueryingAllowedValues('userstory', 'ScheduleState').respondWith ["Idea", "Defined", "In-Progress", "Completed", "Accepted"]
    @createApp({}).then (app) =>
      app._getPostAcceptedState().always (postAcceptedState) ->
        expect(postAcceptedState).toBeNull()

  it "getPostAcceptedState with only an after state", ->
    @ajax.whenQueryingAllowedValues('userstory', 'ScheduleState').respondWith ["Defined", "In-Progress", "Completed", "Accepted", "Released"]
    @createApp({}).then (app) =>
      app._getPostAcceptedState().always (postAcceptedState) ->
        expect(postAcceptedState).toBe "Released"

  it "getPostAcceptedState with a before and after state", ->
    @ajax.whenQueryingAllowedValues('userstory', 'ScheduleState').respondWith ["Idea", "Defined", "In-Progress", "Completed", "Accepted", "Really Really Done"]
    @createApp({}).then (app) =>
      app._getPostAcceptedState().always (postAcceptedState) ->
        expect(postAcceptedState).toBe "Really Really Done"

  it "does not aggregate testset and defectsuite data for HS subscriptions", ->

    @prepareFiveDefectsData()

    @stub(Rally.apps.iterationsummary.IterationSummaryApp.prototype, '_isHsOrTeamEdition').returns true
    testsSpy = @spy(Rally.apps.iterationsummary.IterationSummaryApp.prototype, '_getTestsConfigObject')
    defectSpy = @spy(Rally.apps.iterationsummary.IterationSummaryApp.prototype, '_getDefectsConfigObject')

    app = Ext.create('Rally.apps.iterationsummary.IterationSummaryApp',
      context: @getContext()
    )
    @waitForComponentReady(app).then ->

