Skip to content

Commit ebfaae2

Browse files
committed
fix tests, minor fixes
1 parent 45ff4d9 commit ebfaae2

File tree

8 files changed

+14
-22
lines changed

8 files changed

+14
-22
lines changed

handlers/imgur/controllers/upload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
21
var multiparty = require('multiparty');
32
var uploadStream = require('../lib/uploadStream');
43
var co = require('co');
54
var ImgurImage = require('../models/imgurImage');
5+
var BadImageError = require('../lib/badImageError');
66

77
exports.post = function*() {
88

handlers/imgur/lib/transload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ module.exports = function*(url) {
1414
}
1515
});
1616

17-
yield ImgurImage.createFromResponse(response);
17+
return yield ImgurImage.createFromResponse(response);
1818
};
1919

handlers/imgur/test/server/upload.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('imgur', function() {
2323
server.close();
2424
});
2525

26-
describe('POST /upload', function() {
26+
describe('POST /imgur/upload', function() {
2727

2828
it('returns id after uploading a valid image', function(done) {
2929
request(server)
@@ -33,7 +33,8 @@ describe('imgur', function() {
3333
.expect(200)
3434
.end(function(err, res) {
3535
if (err) return done(err);
36-
res.body.id.should.exist;
36+
res.body.imgurId.should.exist;
37+
res.body.link.should.exist;
3738
done();
3839
});
3940
});

handlers/imgur/test/transload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("imgur", function() {
1212

1313
it("works for a normal url", function*() {
1414
var response = yield* transload(urlExample);
15-
response.should.be.string;
15+
response.imgurId.should.be.string;
1616
});
1717

1818

handlers/users/test/api/id.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,7 @@ describe('Authorization', function() {
3636
});
3737
});
3838

39-
it('transloads the user photo', function(done) {
40-
request(server)
41-
.patch('/users/me')
42-
.set('X-Test-User-Id', fixtures.User[0]._id)
43-
.set('Accept', 'application/json')
44-
.attach('photo', path.join(__dirname, 'me.jpg'))
45-
.end(function(err, res) {
46-
if (err) return done(err);
47-
res.body.photo.should.startWith('http://');
48-
done();
49-
});
50-
});
39+
// todo: test for photoId submission
5140

5241
it('returns not all errors, but only one error if a field is wrong', function(done) {
5342
request(server)

modules/deploy/tasks/build.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,22 @@ module.exports = function() {
1313

1414
var args = require('yargs')
1515
.example('gulp deploy:build --host nightly')
16-
.example('gulp deploy:build --host nightly --npm')
16+
.example('gulp deploy:build --host nightly --with-npm')
1717
.demand(['host'])
1818
.argv;
1919

2020
return function() {
2121

2222
return co(function*() {
2323

24-
2524
var client = yield* sshConnect(args.host);
2625

2726
try {
2827
yield* client.runInBuild(`git reset --hard`);
2928
yield* client.runInBuild(`git fetch origin master`);
3029
yield* client.runInBuild(`git merge origin/master --no-edit`);
3130

32-
if (args.npm) {
31+
if (args.withNpm) {
3332
yield* reinstallModules();
3433
}
3534

@@ -48,7 +47,7 @@ module.exports = function() {
4847

4948
function* reinstallModules() {
5049
yield* client.runInBuild(`rm -rf node_modules`);
51-
yield* client.runInBuild(`npm install`);
50+
yield* client.runInBuild(`npm install --no-spin --node-gyp=pangyp`);
5251
yield* client.runInBuild('git add --force node_modules');
5352
}
5453

modules/deploy/tasks/update.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ module.exports = function() {
2323
var client = yield* sshConnect(args.host);
2424

2525
try {
26+
// make sure tests pass
27+
yield client.runInBuild(`npm test`);
28+
2629
yield* client.runInTarget(`git reset --hard`);
2730
yield* client.runInTarget(`git fetch origin production`);
2831
yield* client.runInTarget(`git merge origin/production --no-edit`);

nginx/http/geoip.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
geoip_country <%=nginxPrefix%>/geoip.dat;
33
geoip_proxy 192.168.0.0/16;
4-
geoip_proxy 10.10.0.0/8;
4+
geoip_proxy 10.0.0.0/8;
55
geoip_proxy 127.0.0.0/16;
66
geoip_proxy_recursive on;
77

0 commit comments

Comments
 (0)