'use strict';

const test = require('ava');
const supertest = require('supertest');
const express = require('express');
const noAuthentication = require('./no-authentication');

test('should add dummy user object to all requests', t => {
    t.plan(1);

    const app = express();
    noAuthentication('', app);
    app.get('/api/admin/test', (req, res) => {
        const user = Object.assign({}, req.user);

        return res
            .status(200)
            .json(user)
            .end();
    });
    const request = supertest(app);

    return request
        .get('/api/admin/test')
        .expect(200)
        .expect(res => {
            console.log(res.body);
            t.true(res.body.email === 'none@unknown.com');
        });
});

@@ -637,43 +637,8 @@
 %3E %7B%0A
-            console.log(res.body);%0A
     

remove console.log in test