describe("helper", function() {
  beforeEach(function() {
    subject = window.helper;
  });
  describe("deviceHourResults", function() {
    beforeEach(function() {
      results = [["desktop","00","76"],["desktop","01","68"],["desktop","02","56"],["desktop","03","34"],["mobile","00","28"],["mobile","01","31"],["mobile","02","28"],["mobile","03","14"]];
    });
    it("returns results for every hour", function() {
      expect(subject.deviceHourResults(results).desktop.length).to.eql(24);
    });
    it("returns zero for results not in google results", function() {
      expect(subject.deviceHourResults(results).desktop[4]).to.eql(0);
    });
    it("returns result aggregated by hour and device", function() {
      expect(subject.deviceHourResults(results).desktop[0]).to.eq(76);
    });
  });
  describe("deviceMinuteInterval", function() {
    beforeEach(function() {
      resultsMinute = [["desktop","00","02","1"],["desktop","00","25","1"],["desktop","00","29","2"],["desktop","00","30","1"],["desktop","00","31","1"]];
    });
    context("every 30 minutes", function() {
      it("returns results for 30 minutes", function() {
        expect(subject.deviceMinuteInterval(resultsMinute, 30).desktop.length).to.eql(48);
      });
      it("returns zero for results not in google results", function() {
        expect(subject.deviceMinuteInterval(resultsMinute, 30).desktop[2]).to.eql(0);
      });
      it("returns result aggregated by 30 minutes and device", function() {
        expect(subject.deviceMinuteInterval(resultsMinute, 30).desktop[1]).to.eql(2);
      });
    });
    context("every 15 minutes", function() {
      it("returns results for 30 minutes", function() {
        expect(subject.deviceMinuteInterval(resultsMinute, 15).desktop.length).to.eql(96);
      });
      it("returns zero for results not in google results", function() {
        expect(subject.deviceMinuteInterval(resultsMinute, 15).desktop[4]).to.eql(0);
      });
      it("returns result aggregated by 15 minutes and device", function() {
        expect(subject.deviceMinuteInterval(resultsMinute, 15).desktop[1]).to.eql(3);
      });

    });
  });
  describe("deviceMinuteIntervalResults", function() {
    beforeEach(function() {
      clock = sinon.useFakeTimers(Date.now());
      var newYorkTimeZoneMidnight = 6;
      var yesterday = -(1000*60*60*24)
      endDate = new Date();
      endDate.setHours(newYorkTimeZoneMidnight,0,0)
      clock.tick(yesterday);
      startDate = new Date();
      startDate.setHours(newYorkTimeZoneMidnight,0,0)
      f = d3.time.format("%Y%m%d");
      resultsMinuteDate = [["desktop",f(startDate),"00","02","1"],["desktop",f(startDate),"00","25","1"],["desktop",f(startDate),"00","29","2"],["desktop",f(startDate),"01","30","1"],["desktop",f(startDate),"01","31","1"]];
    });
    context("every 30 minutes", function() {
      it("returns results for 30 minutes", function() {
        expect(Object.keys(subject.deviceMinuteIntervalResults(resultsMinuteDate, 30, startDate, endDate)).length).to.eql(49);
      });
      it("returns zero for results not in google results", function() {
        var d = new Date()
        d.setHours(7,0,0)
        expect(subject.deviceMinuteIntervalResults(resultsMinuteDate, 30, startDate, endDate)[d].desktop).to.eq(0);
      });
      it("returns result aggregated by 15 minutes and device", function() {
        var d = new Date()
        d.setHours(6,00,0)
        expect(subject.deviceMinuteIntervalResults(resultsMinuteDate, 30, startDate, endDate)[d].desktop).to.eq(4);
      });
    });
  });
  describe("leadingZero", function() {
    context("single digit", function() {
      it("returns the number with leading zero", function() {
        expect(subject.leadingZero(1)).to.eql("01")
      });
    });
    context("double digit", function() {
      it("returns the number", function() {
        expect(subject.leadingZero(10)).to.eql("10")
      });
    });
  });
  describe("#arrayFromObject", function() {
    beforeEach(function() {
      dataObject = {test: {test: 'Test'}, bla: {bla: 'Bla'}};
    });
    it("returns array with objects", function() {
      expect(subject.arrayFromObject(dataObject).length).to.eql(2);
    });
    it("first element is object", function() {
      expect(subject.arrayFromObject(dataObject)[0]).to.eql({test: 'Test'});
    });
  });
});


@@ -2310,17 +2310,17 @@
 night = 
-6
+4
 ;%0A      
@@ -2376,24 +2376,176 @@
 new Date();%0A
+      var currentTimeZoneOffSet = endDate.getTimezoneOffset()/60;%0A      currentTimeZoneNewYorkMidnight = newYorkTimeZoneMidnight-currentTimeZoneOffSet;%0A
       endDat
@@ -3267,32 +3267,90 @@
 %22, function() %7B%0A
+        var oneOClock = currentTimeZoneNewYorkMidnight+1;%0A
         var d = 
@@ -3351,32 +3351,33 @@
 r d = new Date()
+;
 %0A        d.setHo
@@ -3384,14 +3384,23 @@
 urs(
-7
+oneOClock
 ,0,0)
+;
 %0A   
@@ -3624,16 +3624,17 @@
 w Date()
+;
 %0A       
@@ -3649,15 +3649,44 @@
 urs(
-6,0
+currentTimeZoneNewYorkMidnight,
 0,0)
+;
 %0A   

Update test to run correctly in every time zone