test/unit/angularjs/rails/resourceSpec.js in angularjs-rails-resource-0.2.2 vs test/unit/angularjs/rails/resourceSpec.js in angularjs-rails-resource-0.2.3
- old
+ new
@@ -379,9 +379,16 @@
it('should transform attributes on build', function() {
var test = new Test({id: 123, abc_def: "T"});
expect(test).toEqualData({id: 123, abcDef: "T"});
});
+ it('should support constructing with date properties', function () {
+ var testDate = new Date(),
+ test = new Test({id: 123, testDate: testDate});
+
+ expect(test.testDate).toBe(testDate);
+ });
+
angular.forEach(['post', 'put', 'patch'], function (method) {
it('should be able to ' + method + ' to arbitrary url', inject(function($httpBackend) {
var promise, result = {};
promise = Test['$' + method]('/xyz', {id: 123, abc: 'xyz', xyz: 'abc'});