Sha256: 747a67b7a99bb904ba6cafb73cefff3b33836384f94f0a81707dc3bf51933117

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

module('Init');

test('jQuery', function(){
  ok($ === jQuery, '$ === jQuery');
});

module('module');

asyncTest('success load', function(){
  
  ok($.module('underscore') === 404, 'underscore is not loaded');
  
  var i = 0;
  
  $.module('underscore', function(){
    ok($.isFunction(_), '_ is loaded');
    ok($.module('underscore') === 200, 'underscore loaded');
    i++;
    ok(i === 1, 'success func is loaded');
  });
  $.module('underscore', function(){
    i++;
    ok(i === 2, 'twice success func is loaded');
    start();
  });
  
  ok($.module('underscore') === 202, 'underscore is loading');
  
  
});

asyncTest('error load', function(){
  
  ok($.module('null') === 404, 'null is not loaded');
  
  $.module('null', null, function(){
    ok($.module('null') === 500, 'module null is error');
    start();
  });
  
  ok($.module('null') === 202, 'null is loading');
  
});

asyncTest('load remote module', function(){

  var remote = {
    name: 'ui',
    url: 'https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js'
  };
  
  ok($.module(remote) === 404, 'remote is not loaded');
  
  $.module(remote, function(){
    ok((typeof $.ui === 'object'), '$.ui is loaded');
    ok($.module(remote) === 200, 'remote loaded');
    ok($.module('ui') === 200, 'ui is loaded');
    start();
  });
  
  ok($.module(remote) === 202, 'remote is loading');

});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zzf-core-0.0.2 vendor/assets/javascripts/zzf-core-spec.js