Created
March 3, 2011 21:43
-
-
Save tim-evans/853667 to your computer and use it in GitHub Desktop.
Test for SC.RecordAttribute Date transform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp = window.MyApp = {}; | |
MyApp.store = SC.Store.create(); | |
MyApp.Message = SC.Record.extend({ | |
init: function () { | |
this.normalize(); | |
return sc_super(); | |
}, | |
to: SC.Record.attr(String), | |
from: SC.Record.attr(String), | |
timestamp: SC.Record.attr(Date), | |
text: SC.Record.attr(String) | |
}); | |
test("verify Data attributes marshal non-value values (undefined / null)", function () { | |
var message = MyApp.store.createRecord(MyApp.Message, { | |
guid: 'chocolate-moose', | |
to: '[email protected]', | |
from: '[email protected]', | |
text: 'Bork bork bork!' | |
}); | |
ok(SC.none(message.get('timestamp'))); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment