Skip to content

Commit

Permalink
Ensure survey runs during correct window
Browse files Browse the repository at this point in the history
The temporary survey will now run between 2016/02/01 and 2016/05/01.
  • Loading branch information
benlovell committed Jan 28, 2016
1 parent 6482bf9 commit 21b161f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/assets/javascripts/user-satisfaction-survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions spec/javascripts/user-satisfaction-survey-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?");
});
Expand Down

0 comments on commit 21b161f

Please sign in to comment.