Sha256: 9f6d4687ac26797d62462f9580b65ca2d9412d5cadcf23daccf8efcbd25ee8cf

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

var queryable, root;

root = typeof exports !== "undefined" && exports !== null ? exports : window;

queryable = require('indemma/lib/record/queryable.js');

describe('queryable', function() {
  return describe('model', function() {
    beforeEach(function() {
      return this.personable = model.call({
        resource: 'person'
      });
    });
    it('should set the queryable key', function() {
      return model.should.have.property('queryable', true);
    });
    it('should create a storage', function() {
      return this.personable.should.have.property('storage');
    });
    return describe('#find', function() {
      beforeEach(function() {
        this.xhr = jQuery.Deferred();
        sinon.stub(jQuery, "ajax").returns(this.xhr);
        this.arthur = this.personable({
          _id: '1',
          name: 'Arthur Philip Dent'
        });
        this.arthur.save();
        return this.xhr.resolveWith(this.arthur, [this.arthur.json()]);
      });
      afterEach(function() {
        return jQuery.ajax.restore();
      });
      return it('should retrieve a record by key', function() {
        return this.personable.find('1').should.have.property('name', this.arthur.name);
      });
    });
  });
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ende-0.5.22 components/indefinido/indemma/master/spec/record/queryable_spec.js
ende-0.5.21 components/indefinido/indemma/master/spec/record/queryable_spec.js