Sha256: 0dbef542fdf4a4a8314aacdf18e5e6210078a8ca61904e25bbc983e768fae161

Contents?: true

Size: 841 Bytes

Versions: 2

Compression:

Stored size: 841 Bytes

Contents

root = exports ? window

queryable = require 'indemma/lib/record/queryable.js'

describe 'queryable',  ->

  describe 'model', ->
    beforeEach ->
      @personable = model.call
        resource  : 'person'

    it 'should set the queryable key', ->
      model.should.have.property 'queryable', true

    it 'should create a storage', ->
      @personable.should.have.property 'storage'

    describe '#find', ->
      beforeEach ->
        @xhr = jQuery.Deferred()
        sinon.stub(jQuery, "ajax").returns @xhr

        @arthur = @personable
          _id: '1'
          name: 'Arthur Philip Dent'

        @arthur.save()
        @xhr.resolveWith @arthur, [@arthur.json()]

      afterEach  -> jQuery.ajax.restore()

      it 'should retrieve a record by key', ->
        @personable.find('1').should.have.property 'name', @arthur.name

Version data entries

2 entries across 2 versions & 1 rubygems

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