MCPcopy
hub / github.com/strongloop/loopback / testConfirm

Function testConfirm

test/user.test.js:2263–2291  ·  view source on GitHub ↗
(testFunc, done)

Source from the content-addressed store, hash-verified

2261 let verifyOptions;
2262
2263 function testConfirm(testFunc, done) {
2264 User.afterRemote('create', function(ctx, user, next) {
2265 assert(user, 'afterRemote should include result');
2266
2267 verifyOptions = {
2268 type: 'email',
2269 to: user.email,
2270 from: 'noreply@myapp.org',
2271 redirect: 'http://foo.com/bar',
2272 protocol: ctx.req.protocol,
2273 host: ctx.req.get('host'),
2274 };
2275
2276 user.verify(verifyOptions, function(err, result) {
2277 if (err) return done(err);
2278
2279 testFunc(result, done);
2280 });
2281 });
2282
2283 request(app)
2284 .post('/test-users')
2285 .expect('Content-Type', /json/)
2286 .expect(302)
2287 .send({email: 'bar@bat.com', password: 'bar'})
2288 .end(function(err, res) {
2289 if (err) return done(err);
2290 });
2291 }
2292
2293 it('Confirm a user verification', function(done) {
2294 testConfirm(function(result, done) {

Callers 1

user.test.jsFile · 0.85

Calls 1

doneFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…