Sha256: c6ba34c486981b9192292c73dd985b41fc3aab38fb8ef5c01e266377f0e29c68

Contents?: true

Size: 713 Bytes

Versions: 7

Compression:

Stored size: 713 Bytes

Contents

Screw.Unit(function() {
  describe("The REST adapter", function() {
    var ns = ExtMVC.Model.modelNamespace;
    
    var rest      = new ExtMVC.Model.plugin.adapter.RESTAdapter(),
        savedInst = new ns.User({title: 'Ed', id: 100}),
        newInst   = new ns.User({title: 'Nick'});
        
    describe("the instanceUrl method", function() {
      it("should return a url including the ID if the primary key is set", function() {
        expect(rest.instanceUrl(savedInst)).to(equal, '/users/100');
      });
      
      it("should return a generic url for this model if the primary key is not set", function() {
        expect(rest.instanceUrl(newInst)).to(equal, '/users');
      });
    });
  });
});

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/RESTAdapter.spec.js
extjs-mvc-0.4.0.k lib/extjs-mvc/src/spec/model/RESTAdapter.spec.js
extjs-mvc-0.4.0.f lib/src/spec/model/RESTAdapter.spec.js
extjs-mvc-0.4.0.e lib/vendor/spec/model/RESTAdapter.spec.js
extjs-mvc-0.4.0.d lib/vendor/spec/model/RESTAdapter.spec.js
extjs-mvc-0.4.0.b lib/js/spec/model/RESTAdapter.spec.js
extjs-mvc-0.4.0.a lib/js/spec/model/RESTAdapter.spec.js