 
       @waitForComponentReady(@app)
 
+    getIterationFilter: ->
+      iteration = @iterationData[0]
+
+      [
+        { property: 'Iteration.Name', operator: '=', value: iteration.Name },
+        { property: "Iteration.StartDate", operator: '=', value: iteration.StartDate }
+        { property: "Iteration.EndDate", operator: '=', value: iteration.EndDate }
+      ]
+
+    stubRequests: ->
+      userstoryStub = @ajax.whenReading('userstory').respondWith()
+      defectStub = @ajax.whenQuerying('defect').respondWith()
+      defectsuiteStub = @ajax.whenQuerying('defectsuite').respondWith()
+      testsetStub = @ajax.whenQuerying('testset').respondWith()
+      @ajax.whenQueryingAllowedValues('userstory', 'ScheduleState').respondWith(["Defined", "In-Progress", "Completed", "Accepted"]);
+
+      [userstoryStub, defectStub, defectsuiteStub, testsetStub]
+
+    toggleToGridOrBoard: (view) ->
+      toggler = @app.gridboard.down('rallygridboardtoggle')
+      toggler.fireEvent 'toggle', view
+
+    toggleToBoard: ->
+      @toggleToGridOrBoard('board')
+
+    toggleToGrid: ->
+      @toggleToGridOrBoard('grid')
+
   beforeEach ->
     @ajax.whenReading('project').respondWith {
       TeamMembers: []
       Editors: []
     }
 
-    @ajax.whenQuerying('userstory').respondWith()
-    @ajax.whenQuerying('defect').respondWith()
-    @ajax.whenQuerying('defectsuite').respondWith()
-    @ajax.whenQuerying('testset').respondWith()
-    @ajax.whenQueryingAllowedValues('userstory', 'ScheduleState').respondWith(["Defined", "In-Progress", "Completed", "Accepted"]);
+    @stubRequests()
 
     @tooltipHelper = new Helpers.TooltipHelper this
 

    it 'should not show field picker in settings ', ->
      @createApp(isShowingBlankSlate: -> true).then =>
        @app.showFieldPicker = true
        expect(Ext.isEmpty(_.find(@app.getSettingsFields(), name: 'cardFields'))).toBe true
Ext = window.Ext4 || window.Ext

Ext.require [
  'Rally.util.DateTime'
]

describe 'Rally.apps.iterationtrackingboard.IterationTrackingBoardApp', ->
