Skip to content

Commit

Permalink
mozillascience#26 load all the test's necessaire environment variable…
Browse files Browse the repository at this point in the history
…s from system only
  • Loading branch information
aid29 committed Jul 7, 2015
1 parent f48c399 commit 23b7fe7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@ var request = require('supertest');
var assert = require('assert');

var Habitat = require('habitat');
var testEnv = Habitat.load('.env');
var testEnv = new Habitat();

var badgeClient = require('../src/badgeClient.js')(testEnv);
var badgeService = require('../src/badgeService.js')(badgeClient, testEnv);
var app = require('../src/app.js')(badgeService);

function before() {
// without this function declare, jshint report error
}

describe('Intergration test against the real Badge server', function () {
before(function () {
assert.ok(testEnv.get('BADGES_ENDPOINT'), 'should set up BADGES_ENDPOINT in your test environment');
assert.ok(testEnv.get('BADGES_KEY'), 'should set up BADGES_KEY in your test environment');
assert.ok(testEnv.get('BADGES_SECRET'), 'should set up BADGES_SECRET in your test environment');
assert.ok(testEnv.get('BADGES_SYSTEM'), 'should set up BADGES_SYSTEM in your test environment');
});

it('get all the badges', function (done) {
request(app)
.get('/badges')
Expand Down

0 comments on commit 23b7fe7

Please sign in to comment.