Skip to content

Instantly share code, notes, and snippets.

@richmolj
Created September 4, 2015 14:28
Show Gist options
  • Save richmolj/f3648c66db3c070c0f4e to your computer and use it in GitHub Desktop.
Save richmolj/f3648c66db3c070c0f4e to your computer and use it in GitHub Desktop.
`import { moduleFor, test } from 'ember-qunit'`
moduleFor 'serializer:application', 'Unit | Serializer | application',
needs: []
beforeEach: ->
@TestModel = DS.Model.extend
name: DS.attr('string')
updatedAt: DS.attr('date')
test 'it removes updated_at when saving', (assert) ->
serializer = @subject()
internalModel = new DS.InternalModel(@TestModel, null, @container, {})
snapshot = new DS.Snapshot(internalModel)
serializedRecord = serializer.serialize(snapshot)
assert.notOk serializedRecord.data.attributes.hasOwnProperty('updated_at')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment