test/unit/angularjs/rails/resourceSpec.js in angularjs-rails-resource-1.0.0.pre.3 vs test/unit/angularjs/rails/resourceSpec.js in angularjs-rails-resource-1.0.0.pre.4
- old
+ new
@@ -476,9 +476,28 @@
$httpBackend['expectPOST']('/xyz', {tests: data} ).respond(200, {tests: data});
Test.$post('/xyz', data);
$httpBackend.flush();
});
+ it('should not require query params on $delete', function () {
+ $httpBackend.expectDELETE('/test').respond(200);
+ Test.$delete('/test');
+ $httpBackend.flush();
+ });
+
+ it('should add query params passed to class $delete', function () {
+ $httpBackend.expectDELETE('/test?a=1').respond(200);
+ Test.$delete('/test', {a: 1});
+ $httpBackend.flush();
+ });
+
+ it('should add query params passed to instance $delete', function () {
+ var data = new Test({abcDef: 'xyz'});
+
+ $httpBackend.expectDELETE('/test?a=1').respond(200);
+ data.$delete('/test', {a: 1});
+ $httpBackend.flush();
+ });
});
describe('plural', function() {
var $httpBackend, $rootScope, factory, PluralTest,
pluralConfig = {