Skip to content

Commit

Permalink
Moved invoke_mocha, it seemed to be interfering with tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-jack committed Nov 12, 2014
1 parent 13724cd commit e9ea925
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 67 deletions.
2 changes: 1 addition & 1 deletion spec/unit/invoke_mocha.js → invoke_mocha.js
Expand Up @@ -11,7 +11,7 @@ var mocha = new Mocha({
// Then, you need to use the method "addFile" on the mocha
// object for each file.

var testDirectory = __dirname + "/resource/validate/";
var testDirectory = __dirname + "/spec/unit/resource/validate/";

// Here is an example:
fs.readdirSync(testDirectory).filter(function (file) {
Expand Down
31 changes: 0 additions & 31 deletions spec/integration/invoke_mocha.js

This file was deleted.

70 changes: 35 additions & 35 deletions spec/integration/requests/get_no_cachine_specified_spec.js
@@ -1,42 +1,42 @@
//var resourceTest = require('testresources')
//var fixture = require('./../integrationTestFixture')
var resourceTest = require('testresources')
var fixture = require('./../integrationTestFixture')

//var assert = fixture.assert;
//var superAgent = require('superagent');
var assert = fixture.assert;
var superAgent = require('superagent');

//describe('when you test a get request and resource returns json which is not cacheable', function () {
// var request;
// var expectedBody;
// var expectedAddressBody;
describe('when you test a get request and resource returns json which is not cacheable', function () {
var request;
var expectedBody;
var expectedAddressBody;

// before(fixture.ensureSetup);
before(fixture.ensureSetup);

// beforeEach(function () {
// request = superAgent.get(fixture.server.fullUrl('/people/5'));
beforeEach(function () {
request = superAgent.get(fixture.server.fullUrl('/people/5'));

// expectedBody = {
// firstName : "Colin",
// secondName : "Jack",
// id : '5',
// address: "http://127.0.0.1:" + fixture.port + "/address/5"
// }
expectedBody = {
firstName : "Colin",
secondName : "Jack",
id : '5',
address: "http://127.0.0.1:" + fixture.port + "/address/5"
}

// expectedAddressBody = {
// "House Number": 72,
// "Stree Name": "Fox Lane",
// "Town": "Edinburgh",
// "PostCode": "EH99 7JJ"
// };
// });
expectedAddressBody = {
"House Number": 72,
"Stree Name": "Fox Lane",
"Town": "Edinburgh",
"PostCode": "EH99 7JJ"
};
});

// it('should respond with appropriate body', function () {
// return resourceTest(request)
// .expectBody(expectedBody)
// .expectNotCached()
// .followLink("address")
// .expectBody(expectedAddressBody)
// .expectCachedForever("public")
// .endLink()
// .run(fixture.server);
// });
//});
it('should respond with appropriate body', function () {
return resourceTest(request)
.expectBody(expectedBody)
.expectNotCached()
.followLink("address")
.expectBody(expectedAddressBody)
.expectCachedForever("public")
.endLink()
.run(fixture.server);
});
});

0 comments on commit e9ea925

Please sign in to comment.