File tree Expand file tree Collapse file tree 8 files changed +14
-22
lines changed
Expand file tree Collapse file tree 8 files changed +14
-22
lines changed Original file line number Diff line number Diff line change 1-
21var multiparty = require ( 'multiparty' ) ;
32var uploadStream = require ( '../lib/uploadStream' ) ;
43var co = require ( 'co' ) ;
54var ImgurImage = require ( '../models/imgurImage' ) ;
5+ var BadImageError = require ( '../lib/badImageError' ) ;
66
77exports . post = function * ( ) {
88
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 } ) ;
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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` ) ;
Original file line number Diff line number Diff line change 11
22geoip_country <%=nginxPrefix%>/geoip.dat;
33geoip_proxy 192.168.0.0/16;
4- geoip_proxy 10.10 .0.0/8;
4+ geoip_proxy 10.0 .0.0/8;
55geoip_proxy 127.0.0.0/16;
66geoip_proxy_recursive on;
77
You can’t perform that action at this time.
0 commit comments