@ -4,6 +4,7 @@ var async = require('async');
var assert = require ( 'assert' ) ;
var assert = require ( 'assert' ) ;
var nconf = require ( 'nconf' ) ;
var nconf = require ( 'nconf' ) ;
var path = require ( 'path' ) ;
var path = require ( 'path' ) ;
var request = require ( 'request' ) ;
var db = require ( './mocks/databasemock' ) ;
var db = require ( './mocks/databasemock' ) ;
var categories = require ( '../src/categories' ) ;
var categories = require ( '../src/categories' ) ;
@ -247,12 +248,19 @@ describe('Upload Controllers', function () {
} ) ;
} ) ;
it ( 'should upload touch icon' , function ( done ) {
it ( 'should upload touch icon' , function ( done ) {
var touchiconAssetPath = '/assets/uploads/system/touchicon-orig.png' ;
helpers . uploadFile ( nconf . get ( 'url' ) + '/api/admin/uploadTouchIcon' , path . join ( _ _dirname , '../test/files/test.png' ) , { } , jar , csrf _token , function ( err , res , body ) {
helpers . uploadFile ( nconf . get ( 'url' ) + '/api/admin/uploadTouchIcon' , path . join ( _ _dirname , '../test/files/test.png' ) , { } , jar , csrf _token , function ( err , res , body ) {
assert . ifError ( err ) ;
assert . ifError ( err ) ;
assert . equal ( res . statusCode , 200 ) ;
assert . equal ( res . statusCode , 200 ) ;
assert ( Array . isArray ( body ) ) ;
assert ( Array . isArray ( body ) ) ;
assert . equal ( body [ 0 ] . url , '/assets/uploads/system/touchicon-orig.png' ) ;
assert . equal ( body [ 0 ] . url , touchiconAssetPath ) ;
done ( ) ;
meta . config [ 'brand:touchIcon' ] = touchiconAssetPath ;
request ( nconf . get ( 'url' ) + '/apple-touch-icon' , function ( err , res , body ) {
assert . ifError ( err ) ;
assert . equal ( res . statusCode , 200 ) ;
assert ( body ) ;
done ( ) ;
} ) ;
} ) ;
} ) ;
} ) ;
} ) ;
} ) ;
} ) ;