Sha256: 14066d922215050834d458056079432a178294eca6147889fadcde81395ff3fc

Contents?: true

Size: 1.64 KB

Versions: 7

Compression:

Stored size: 1.64 KB

Contents

Screw.Unit(function() {
  describe("The Abstract Adapter", function() {
    var ns = ExtMVC.Model.modelNamespace;
    
    describe("instance methods", function() {
      it("should add instance methods to Ext.data.Record's prototype", function() {
        var p = Ext.data.Record.prototype;
        
        Ext.each(['save', 'destroy', 'update'], function(methodName) {
          expect(typeof p[methodName]).to(equal, 'function');
        }, this);
      });
      
      describe("the save method", function() {
        
      });
    });
    
    describe("class methods", function() {
      it("should add class methods to each model class", function() {
        Ext.each(['create', 'build', 'find', 'destroy'], function(methodName) {
          for (var model in ns) {
            expect(typeof ns[model][methodName]).to(equal, 'function');
          }
        }, this);
      });
    });
    
    describe("hasMany association methods", function() {
      it("should add the correct methods to the hasMany prototype", function() {
        var p = ExtMVC.Model.plugin.association.HasMany.prototype;
        
        Ext.each(['create', 'build', 'find', 'destroy'], function(methodName) {
          expect(typeof p[methodName]).to(equal, 'function');
        }, this);
      });
    });
    
    describe("belongsTo association methods", function() {
      it("should add the correct methods to the hasMany prototype", function() {
        var p = ExtMVC.Model.plugin.association.HasMany.prototype;
        
        Ext.each(['find', 'destroy'], function(methodName) {
          expect(typeof p[methodName]).to(equal, 'function');
        }, this);
      });
    });
  });
});

Version data entries

7 entries across 6 versions & 1 rubygems

Version Path
extjs-mvc-0.4.0.k test/app/vendor/extjs-mvc/spec/model/AbstractAdapter.spec.js
extjs-mvc-0.4.0.k lib/extjs-mvc/src/spec/model/AbstractAdapter.spec.js
extjs-mvc-0.4.0.f lib/src/spec/model/AbstractAdapter.spec.js
extjs-mvc-0.4.0.e lib/vendor/spec/model/AbstractAdapter.spec.js
extjs-mvc-0.4.0.d lib/vendor/spec/model/AbstractAdapter.spec.js
extjs-mvc-0.4.0.b lib/js/spec/model/AbstractAdapter.spec.js
extjs-mvc-0.4.0.a lib/js/spec/model/AbstractAdapter.spec.js