Sha256: 654ca80a6b6a422b70804534bcf2d4cc9aae5b18a62490e759123e32c508c589

Contents?: true

Size: 745 Bytes

Versions: 2

Compression:

Stored size: 745 Bytes

Contents

'use strict'

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

describe 'maid', ->

  beforeEach ->
    @personable = model.call
      resource: 'person'
      washing: true
  
  it 'should save upon record dirtying', (done) ->
    @arthur = @personable name: 'Arthur Dent'
    
    sinon.stub(@arthur, 'save').returns true
    @arthur.name = 'Arthur Philip Dent'
    
    setTimeout =>
      @arthur.save.called.should.be.true
      done()
    , 1000


  it 'should not save upon record creation', (done) ->
    @timeout 10000
    sinon.stub(jQuery, "ajax").returns(jQuery.Deferred())
    @arthur = @personable name: 'Arthur Dent'

    setTimeout =>
      jQuery.ajax.called.should.be.false
      jQuery.ajax.restore()
      done()
    , 2000
    

Version data entries

2 entries across 2 versions & 1 rubygems

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