User default admin credentials for API tests

pull/5329/head
Rodrigo Nascimento 9 years ago
parent 82a6617283
commit d1c296069c
No known key found for this signature in database
GPG Key ID: 2C85B3AFE75D23F9
  1. 8
      tests/steps/API.js

@ -6,6 +6,8 @@ import supertest from 'supertest';
const request = supertest('http://localhost:3000');
const prefix = '/api/v1/';
import {adminUsername, adminEmail, adminPassword} from '../data/user.js';
function api(path) {
return prefix + path;
}
@ -24,8 +26,8 @@ const credentials = {
};
const login = {
user: process.env.ADMIN_USERNAME,
password: process.env.ADMIN_PASS
user: adminUsername,
password: adminPassword
};
describe('API default', () => {
@ -78,7 +80,7 @@ describe('API v1', () => {
expect(res.body).to.have.property('username', login.user);
expect(res.body).to.have.property('active');
expect(res.body).to.have.property('name');
expect(res.body).to.have.deep.property('emails[0].address', process.env.ADMIN_EMAIL);
expect(res.body).to.have.deep.property('emails[0].address', adminEmail);
})
.end(done);
});

Loading…
Cancel
Save