var pingPong = function(i) {
  if ((i % 5 === 0) || (i % 3 === 0)) {
    return true;
  } else {
    return false;
  }
};

$(function() {
  $("#game").submit(function(event) {
    $('#outputList').empty();

    var number = parseInt($("#userNumber").val());

    for (var i = 1; i <= number; i += 1) {
      if (i % 15 === 0) {
        $('#outputList').append("<li>ping pong</li>");
      } else if (i % 3 === 0) {
        $('#outputList').append("<li>ping</li>");
      } else if (i % 5 === 0) {
        $('#outputList').append("<li>pong</li>");
      } else {
        $('#outputList').append("<li>" + i + "</li>");
      }
    }
    event.preventDefault();
  });
});

var pingPong = function(i) {
  if (isPingPong) {
    if (i % 15 === 0) {
      return "pingpong";
    } else if (i % 3 === 0) {
      return "ping";
    } else if (i % 5 === 0) {
      return "pong";
    }
  } else {
    return false;
  }
}

var isPingPong = function(i) {
  if ((i % 5 === 0) || (i % 3 === 0)){
    return true;
  } else {
    return false;
  }
}

$(function() {
  $("#game").submit(function(event) {
    $('#outputList').empty();

    var number = parseInt($("#userNumber").val());
    

    for (var i = 1; i <= number; i += 1) {
      if (winner) {
        $('#outputList').append("<li>" + winner +"</li>");
      } else if (!winner){
        $('#outputList').append("<li>" + i +"</li>");
      }
    }
    event.preventDefault();
  });
});

Refactor spec test into two parts, isPingPong and pingPong
Refactor spec test into two parts, isPingPong and pingPong
