From 21b161f2dc6642ee4425b69f666f7db8288f3154 Mon Sep 17 00:00:00 2001 From: Ben Lovell Date: Thu, 28 Jan 2016 14:16:08 +0000 Subject: [PATCH] Ensure survey runs during correct window The temporary survey will now run between 2016/02/01 and 2016/05/01. --- app/assets/javascripts/user-satisfaction-survey.js | 4 ++-- spec/javascripts/user-satisfaction-survey-spec.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/user-satisfaction-survey.js b/app/assets/javascripts/user-satisfaction-survey.js index 7a59d510d..5c111c631 100644 --- a/app/assets/javascripts/user-satisfaction-survey.js +++ b/app/assets/javascripts/user-satisfaction-survey.js @@ -67,8 +67,8 @@ setSurveyUrl: function(href) { var $surveyLink = $('#take-survey'); var surveyUrl = $('#user-satisfaction-survey-container').data('survey-url'); - var surveyStarts = new Date("January 26, 2016").getTime(); - var surveyEnds = new Date("January 27, 2016 23:59:59").getTime(); + var surveyStarts = new Date("February 1, 2016").getTime(); + var surveyEnds = new Date("May 1, 2016 23:59:59").getTime(); if (userSatisfaction.currentDate() >= surveyStarts && userSatisfaction.currentDate() <= surveyEnds) { diff --git a/spec/javascripts/user-satisfaction-survey-spec.js b/spec/javascripts/user-satisfaction-survey-spec.js index b728ded73..ebe4e2e21 100644 --- a/spec/javascripts/user-satisfaction-survey-spec.js +++ b/spec/javascripts/user-satisfaction-survey-spec.js @@ -37,14 +37,14 @@ describe("User Satisfaction Survey", function () { expect(survey.currentDate()).not.toBe(undefined); }); - it("uses the temporary survey URL on 26/01/2016", function() { - spyOn(survey, 'currentDate').and.returnValue(new Date("January 26, 2016").getTime()); + it("uses the temporary survey URL on 01/02/2016", function() { + spyOn(survey, 'currentDate').and.returnValue(new Date("February 1, 2016").getTime()); survey.showSurveyBar(); expect($('#take-survey').attr('href')).toMatch("https://www.surveymonkey.co.uk/r/2MRDLTW?"); }); - it("uses the temporary survey URL on 27/01/2016", function() { - spyOn(survey, 'currentDate').and.returnValue(new Date("January 27, 2016 12:15:30").getTime()); + it("uses the temporary survey URL on 01/05/2016", function() { + spyOn(survey, 'currentDate').and.returnValue(new Date("May 1, 2016 12:15:30").getTime()); survey.showSurveyBar(); expect($('#take-survey').attr('href')).toMatch("https://www.surveymonkey.co.uk/r/2MRDLTW?"); });