mirror of
https://github.com/eggjs/egg.git
synced 2024-12-04 07:14:30 +00:00
* feat: [BREAKING_CHANGE] use egg-core * fix: miss app and config to publish * deps: upgrade egg-rest * deps: update using autod * test: use supertest@2 * Release 0.1.0-beta.3 * feat: enable logrotater by default * chore: add circleci * refactor: rename logrotater => logrotator * feat: remove log-reload event * test: let examples pass test * fix: remove more close event * refactor: extract Symbol as a constant * deps: upgrade egg-core * Release 0.1.0-beta.4 * fix: use egg when customEgg is not specified
28 lines
629 B
JavaScript
28 lines
629 B
JavaScript
'use strict';
|
|
|
|
const request = require('supertest');
|
|
const utils = require('../../utils');
|
|
|
|
describe('test/lib/plugins/userrole.test.js', () => {
|
|
let app;
|
|
before(() => {
|
|
app = utils.app('apps/userrole');
|
|
return app.ready();
|
|
});
|
|
after(() => app.close());
|
|
|
|
it('should GET /user 200 when user login', () => {
|
|
return request(app.callback())
|
|
.get('/user?name=user2')
|
|
.expect('hello user2')
|
|
.expect(200);
|
|
});
|
|
|
|
it('should GET /admin 200 when admin login', () => {
|
|
return request(app.callback())
|
|
.get('/admin?name=fengmk2')
|
|
.expect('hello admin')
|
|
.expect(200);
|
|
});
|
|
});
|