Sha256: 36366c4926e6cf0704f0285eb465d138ea8980fd862cf3c54f7568641f2d823a

Contents?: true

Size: 580 Bytes

Versions: 4

Compression:

Stored size: 580 Bytes

Contents

var id = 2;
buster.testCase("Check ajax appender", {
  setUp: function() {
    JLog.handleError = function(error) { throw error };
    this.timeout = 2000;
  },

  tearDown: function() {
  },

  "Check timeout": function() {
    sinon.stub($, "ajax");
    var aa = new JLog.AjaxAppender("/catcher");
    aa.append(new JLog.LoggingEvent(null, new Date(), JLog.Level.INFO, "hello", null));
    var d = when.defer();
    setTimeout(function() {
      assert($.ajax.calledOnce, "Data has to be sent");
      d.resolver.resolve();
    }.bind(this), 1300)
    return d.promise;
  }
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jlog-rails-0.2.3 test/ajax-appender-test.js
jlog-rails-0.2.2 test/ajax-appender-test.js
jlog-rails-0.2.1 test/ajax-appender-test.js
jlog-rails-0.2.0 test/ajax-appender-test.js