Example #1
0
   it('can delete a user' , function(done){
     superagent.del('http://localhost:3000/users/' + id).end(function(e,res){
       expect(e).to.eql(null);
       expect(res.body.msg).to.be.eql('success');
 
       done();
     });
   })
Example #2
0
			function(model, cb) {
				request.del('localhost:2000/comments/'+ model._id).end(function(res) {
					CommentModel.count({}, function(err, cnt){
						expect(cnt).to.be(0);
						cb(null, res);
					});
				});	
			}
Example #3
0
 return (cb) => {
   Request.del(`${apiUrl}/categories/${data.id}/convert_products_to/${data.new_id}`)
     .send(data)
     .end((err, res) => {
       if (err) return cb(true);
       cb(null, res.body);
     });
 };
Example #4
0
 it('should delete offer2', function (done) {
   request
     .del(offer2.offer_url)
     .end(function (err, res) {
       assert.equal(res.status, 200);
       done();
     });
 });
 deleteActivity: function(activityId, callbackFunction) {
     request
         .del('/activities/' + activityId)
         .end(function(response) {
             _handleErrors(response);
             callbackFunction(activityId);
     });
 },
Example #6
0
 handleRequest(url, options, function (url, options) {
     request.del(url)
         .set(options.headers)
         .query(options.query)
         .end(function (err, res) {
             handleResponse(err, res, callback);
         });
 });
Example #7
0
					.end(function(err, res) {
						hlp.expectStatus(err, res, 201);
						request
							.del('/api/v1/games/' + res.body.id)
							.save({ path: 'games/delete'})
							.as(user)
							.end(hlp.status(204, done));
					});
Example #8
0
 }, function(){
     superagent.del('http://localhost:7000/myPath')
     .query({query:"a-query"})
     .end(function(_, res) {
         Simulado.lastRequest("DELETE", "/myPath").params.should.deep.equal({query:"a-query"});
         done()
     });
 });
Example #9
0
 return new Promise(function(resolve, reject) {
   Request.del(url)
     .set('Content-Type', 'application/json')
     .set('Accept', 'application/json')
     .end(function (err, res) {
       err ? reject(err) : resolve(res);
     })
 });
Example #10
0
 getApiToken(token => {
   request
     .del(`${getApiPath()}/v2/comments/${id}`)
     .set('Authorization', `Bearer ${token}`)
     .end((err, res) => {
       err ? reject(err) : resolve(res.body.comment);
     });
 }, true);
Example #11
0
 it('Deletes a task', function (done) {
   request.del('http://localhost:3001/todolist/tasks/'+id)
   .end(function (err, res) {
     expect(err).toEqual(null)
     expect(res.body.msg).toEqual('success')
     done()
   })
 })
Example #12
0
Relax.prototype.drop = function(name, cb) {
    var path = this.opts.server+'/'+name;
    var req = request.del(path);
    if (!cb) return req;
    req.end(function(err, res) {
        (res.ok) ? cb(null, res.ok) : cb(null, JSON.parse(res.text.trim()) );
    });
};
Example #13
0
Relax.prototype.logout = function(cb) {
    var path = this.opts.server + '/_session';
    var req = request.del(path);
    if (!cb) return req;
    req.end(function(err, res) {
        (res.ok) ? cb(null, JSON.parse(res.text)) : cb(err, null);
    });
};
	it('remove test user', function (done){
		request.del('localhost:3000/users/deleteUserByUsername/testRohit1')
		.set('cookie', self.cookie) 
		.end(function (response){
			response.status.should.equal(200);
			done();
		});
	});
Example #15
0
	destroy: function(id) {
		request
			.del(API_BASE + '/todos/' + id)
			.end(function(err, res) {
				if (err) TodoServerActions.destroyFailure(err);
				TodoServerActions.destroySuccess(id);
			});
	},
Example #16
0
 }, function(){
     superagent.del('http://localhost:7000/myPath')
     .set('my-header', 'my-value')
     .end(function(_, res) {
         Simulado.lastRequest("DELETE", "/myPath").headers.should.include({'my-header':'my-value'});
         done()
     });
 });
Example #17
0
	destroyCompleted: function() {
		request
			.del(API_BASE + '/todos/complete')
			.end(function(err, res) {
				if (err) TodoServerActions.destroyCompletedFailure(err);
				TodoServerActions.destroyCompletedSuccess();
			});
	}
Example #18
0
 removePermission: function(permission, profile) {
     request.del('/api/users/' + profile.user.id + '/permissions')
         .send({permission: permission})
         .end(function(err, res) {
             if (err) return;
             this.fetch();
         }.bind(this));
 },
    it('can remove a user', function(done) {
        superagent.del('http://localhost:3000/users/' + id).end(function(e, res) {
			expect(res.status).toEqual(200)
			expect(typeof res.body).toEqual('number')
			expect(res.body).toBeGreaterThan(0);
            done();
        })
    });
Example #20
0
		it('should remove the specified guild', function(done) {
			superagent.del(baseUrl + '/guilds/' + existingGuild.id)
			.end((err, res) => {
				expect(err).not.to.exist;
				expect(res.body._id).to.eql(existingGuild.id);
				done();
			})
		});
Example #21
0
	it('can succesfully delete a note', function(done) {
		superagent.del('http://localhost:3000/api/v0_0_1/notes/' + id)
			.end(function(err, res) {
				expect(err).to.eql(null);

				done();
			});
	});
Example #22
0
 return (cb) => {
   Request.del(`${apiUrl}${path}`)
     .send(data)
     .end((err, res) => {
       if (err) return cb(true);
       cb(null, res.body);
     });
 };
 it('should be delete one photo by id', done => {
   request
     .del(url.resolve(ABS_URL, 'photos/'+id))
     .end((err, res) => {
       res.status.should.be.eql(204)
       done();
     });
 });
	it('Should be able to delete without any problems on calling DEL /api/notifications', function (done){
		request.del('http://localhost:3000/api/notifications/'+testNotificationId)
		.set('cookie', self.cookie) 
		.end(function (response){
			response.status.should.equal(200);
			done();
		});
	});
Example #25
0
module.exports.del = function (url, callback) {
  var name = 'DELETE ' + url
  debug('--> %s', name)
  return superagent
    .del(url)
    .use(prefix)
    .use(nocache)
    .end(response(name, callback))
}
Example #26
0
    deletePhoto: function(ev) {
        ev.preventDefault();

        request.del('/api/clubs/' + this.state.slug + '/logo')
            .end(function(err, res) {
                if (err) return;
                this.fetch(this.state.slug);
            }.bind(this));
    },
Example #27
0
    it('removes an object', function(done){
        superagent.del('http://localhost:3000/collections/test/'+id)
            .end(function(e, res){
                expect(e).to.eql(null)
                expect(typeof res.body).to.eql('object');
                expect(res.body.msg).to.eql('success');

                done()
            }) })
Example #28
0
function teardown(config){
    const cdb =
          config.couchdb.host+':'+config.couchdb.port
          + '/'+ config.couchdb.db
    return superagent.del(cdb)
        .type('json')
        .auth(config.couchdb.auth.username
              ,config.couchdb.auth.password)
}
Example #29
0
User.prototype.destroy = function (fn) {
  var db = this.database

  var req = request
    .del(utils.url(db.connection, 'db/' + db.name + '/users/' + this.name))
    .query(utils.qs(db.connection))

  return utils.maybeCall(fn, utils.req(req))
}
Example #30
0
 it('Delete it - DEL ' + dbid, function (done) {
     request
       .del('http://localhost:3000/app/services/:id')
       .end(function (res) {
           res.statusCode.should.equal(200);
           res.body.success.should.equal(true);
           done();
       });
 });